diff --git a/CHANGELOG.md b/CHANGELOG.md index a3d2172..8dd1ef1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# dbt_linkedin v0.6.1 + +## Bugfixes +- `linkedin_ads__url_report` will now effectively filter out all those entries from `stg_linkedin_ads__creative_history` that are not the latest version of the creative. ([PR #26](https://github.com/fivetran/dbt_linkedin/pull/26)) + +## Contributors +- [@aleix-cd](https://github.com/aleix-cd) ([PR #26](https://github.com/fivetran/dbt_linkedin/pull/26)) + # dbt_linkedin v0.6.0 ## 🚨 Breaking Changes 🚨: @@ -84,4 +92,4 @@ vars: - Please note, if you are installing a version of `dbt_utils` in your `packages.yml` that is not in the range above then you will encounter a package dependency error. # dbt_linkedin v0.1.0 -> v0.3.0 -Refer to the relevant release notes on the Github repository for specific details for the previous releases. Thank you! \ No newline at end of file +Refer to the relevant release notes on the Github repository for specific details for the previous releases. Thank you! diff --git a/dbt_project.yml b/dbt_project.yml index cb55b8a..f4c6c3a 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'linkedin' -version: '0.6.0' +version: '0.6.1' config-version: 2 require-dbt-version: [">=1.3.0", "<2.0.0"] vars: diff --git a/docs/catalog.json b/docs/catalog.json index 8611761..8f478f4 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-12-20T02:42:48.482132Z", "invocation_id": "c6defb77-4ceb-4ee2-acc8-e4157c757363", "env": {}}, "nodes": {"seed.linkedin_integration_tests.linkedin_account_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_account_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "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.linkedin_integration_tests.linkedin_account_history_data"}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_ad_analytics_by_campaign_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "_fivetran_synced": {"type": "text", "index": 3, "name": "_fivetran_synced", "comment": null}, "action_clicks": {"type": "integer", "index": 4, "name": "action_clicks", "comment": null}, "ad_unit_clicks": {"type": "integer", "index": 5, "name": "ad_unit_clicks", "comment": null}, "approximate_unique_impressions": {"type": "integer", "index": 6, "name": "approximate_unique_impressions", "comment": null}, "card_clicks": {"type": "integer", "index": 7, "name": "card_clicks", "comment": null}, "card_impressions": {"type": "integer", "index": 8, "name": "card_impressions", "comment": null}, "clicks": {"type": "integer", "index": 9, "name": "clicks", "comment": null}, "comment_likes": {"type": "integer", "index": 10, "name": "comment_likes", "comment": null}, "comments": {"type": "integer", "index": 11, "name": "comments", "comment": null}, "company_page_clicks": {"type": "integer", "index": 12, "name": "company_page_clicks", "comment": null}, "conversion_value_in_local_currency": {"type": "integer", "index": 13, "name": "conversion_value_in_local_currency", "comment": null}, "cost_in_local_currency": {"type": "double precision", "index": 14, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "double precision", "index": 15, "name": "cost_in_usd", "comment": null}, "external_website_conversions": {"type": "integer", "index": 16, "name": "external_website_conversions", "comment": null}, "external_website_post_click_conversions": {"type": "integer", "index": 17, "name": "external_website_post_click_conversions", "comment": null}, "external_website_post_view_conversions": {"type": "integer", "index": 18, "name": "external_website_post_view_conversions", "comment": null}, "follows": {"type": "integer", "index": 19, "name": "follows", "comment": null}, "full_screen_plays": {"type": "integer", "index": 20, "name": "full_screen_plays", "comment": null}, "impressions": {"type": "integer", "index": 21, "name": "impressions", "comment": null}, "landing_page_clicks": {"type": "integer", "index": 22, "name": "landing_page_clicks", "comment": null}, "lead_generation_mail_contact_info_shares": {"type": "integer", "index": 23, "name": "lead_generation_mail_contact_info_shares", "comment": null}, "lead_generation_mail_interested_clicks": {"type": "integer", "index": 24, "name": "lead_generation_mail_interested_clicks", "comment": null}, "likes": {"type": "integer", "index": 25, "name": "likes", "comment": null}, "one_click_lead_form_opens": {"type": "integer", "index": 26, "name": "one_click_lead_form_opens", "comment": null}, "one_click_leads": {"type": "integer", "index": 27, "name": "one_click_leads", "comment": null}, "opens": {"type": "integer", "index": 28, "name": "opens", "comment": null}, "other_engagements": {"type": "integer", "index": 29, "name": "other_engagements", "comment": null}, "shares": {"type": "integer", "index": 30, "name": "shares", "comment": null}, "text_url_clicks": {"type": "integer", "index": 31, "name": "text_url_clicks", "comment": null}, "total_engagements": {"type": "integer", "index": 32, "name": "total_engagements", "comment": null}, "video_completions": {"type": "integer", "index": 33, "name": "video_completions", "comment": null}, "video_first_quartile_completions": {"type": "integer", "index": 34, "name": "video_first_quartile_completions", "comment": null}, "video_midpoint_completions": {"type": "integer", "index": 35, "name": "video_midpoint_completions", "comment": null}, "video_starts": {"type": "integer", "index": 36, "name": "video_starts", "comment": null}, "video_third_quartile_completions": {"type": "integer", "index": 37, "name": "video_third_quartile_completions", "comment": null}, "video_views": {"type": "integer", "index": 38, "name": "video_views", "comment": null}, "viral_card_clicks": {"type": "integer", "index": 39, "name": "viral_card_clicks", "comment": null}, "viral_card_impressions": {"type": "integer", "index": 40, "name": "viral_card_impressions", "comment": null}, "viral_clicks": {"type": "integer", "index": 41, "name": "viral_clicks", "comment": null}, "viral_comment_likes": {"type": "integer", "index": 42, "name": "viral_comment_likes", "comment": null}, "viral_comments": {"type": "integer", "index": 43, "name": "viral_comments", "comment": null}, "viral_company_page_clicks": {"type": "integer", "index": 44, "name": "viral_company_page_clicks", "comment": null}, "viral_external_website_conversions": {"type": "integer", "index": 45, "name": "viral_external_website_conversions", "comment": null}, "viral_external_website_post_click_conversions": {"type": "integer", "index": 46, "name": "viral_external_website_post_click_conversions", "comment": null}, "viral_external_website_post_view_conversions": {"type": "integer", "index": 47, "name": "viral_external_website_post_view_conversions", "comment": null}, "viral_follows": {"type": "integer", "index": 48, "name": "viral_follows", "comment": null}, "viral_full_screen_plays": {"type": "integer", "index": 49, "name": "viral_full_screen_plays", "comment": null}, "viral_impressions": {"type": "integer", "index": 50, "name": "viral_impressions", "comment": null}, "viral_landing_page_clicks": {"type": "integer", "index": 51, "name": "viral_landing_page_clicks", "comment": null}, "viral_likes": {"type": "integer", "index": 52, "name": "viral_likes", "comment": null}, "viral_one_click_lead_form_opens": {"type": "integer", "index": 53, "name": "viral_one_click_lead_form_opens", "comment": null}, "viral_one_click_leads": {"type": "integer", "index": 54, "name": "viral_one_click_leads", "comment": null}, "viral_other_engagements": {"type": "integer", "index": 55, "name": "viral_other_engagements", "comment": null}, "viral_shares": {"type": "integer", "index": 56, "name": "viral_shares", "comment": null}, "viral_total_engagements": {"type": "integer", "index": 57, "name": "viral_total_engagements", "comment": null}, "viral_video_completions": {"type": "integer", "index": 58, "name": "viral_video_completions", "comment": null}, "viral_video_first_quartile_completions": {"type": "integer", "index": 59, "name": "viral_video_first_quartile_completions", "comment": null}, "viral_video_midpoint_completions": {"type": "integer", "index": 60, "name": "viral_video_midpoint_completions", "comment": null}, "viral_video_starts": {"type": "integer", "index": 61, "name": "viral_video_starts", "comment": null}, "viral_video_third_quartile_completions": {"type": "integer", "index": 62, "name": "viral_video_third_quartile_completions", "comment": null}, "viral_video_views": {"type": "integer", "index": 63, "name": "viral_video_views", "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.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_ad_analytics_by_creative_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"creative_id": {"type": "integer", "index": 1, "name": "creative_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost_in_local_currency": {"type": "integer", "index": 5, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "integer", "index": 6, "name": "cost_in_usd", "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.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"}, "seed.linkedin_integration_tests.linkedin_campaign_group_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_campaign_group_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 4, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_group_history_data"}, "seed.linkedin_integration_tests.linkedin_campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_campaign_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "campaign_group_id": {"type": "integer", "index": 4, "name": "campaign_group_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 5, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "version_tag": {"type": "integer", "index": 7, "name": "version_tag", "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.linkedin_integration_tests.linkedin_campaign_history_data"}, "seed.linkedin_integration_tests.linkedin_creative_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_creative_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}, "click_uri": {"type": "character varying", "index": 8, "name": "click_uri", "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.linkedin_integration_tests.linkedin_creative_history_data"}, "model.linkedin.linkedin_ads__account_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__account_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "account_id": {"type": "integer", "index": 2, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 3, "name": "account_name", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "type": {"type": "text", "index": 7, "name": "type", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 10, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 11, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 12, "name": "cost", "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.linkedin.linkedin_ads__account_report"}, "model.linkedin.linkedin_ads__campaign_group_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__campaign_group_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "campaign_group_id": {"type": "integer", "index": 2, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 3, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 5, "name": "account_name", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "currency": {"type": "text", "index": 7, "name": "currency", "comment": null}, "is_backfilled": {"type": "boolean", "index": 8, "name": "is_backfilled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 9, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 10, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 11, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 13, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 14, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 15, "name": "cost", "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.linkedin.linkedin_ads__campaign_group_report"}, "model.linkedin.linkedin_ads__campaign_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__campaign_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "campaign_group_id": {"type": "integer", "index": 5, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 6, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 7, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 8, "name": "account_name", "comment": null}, "campaign_status": {"type": "text", "index": 9, "name": "campaign_status", "comment": null}, "campaign_group_status": {"type": "text", "index": 10, "name": "campaign_group_status", "comment": null}, "type": {"type": "text", "index": 11, "name": "type", "comment": null}, "cost_type": {"type": "text", "index": 12, "name": "cost_type", "comment": null}, "creative_selection": {"type": "text", "index": 13, "name": "creative_selection", "comment": null}, "daily_budget_amount": {"type": "double precision", "index": 14, "name": "daily_budget_amount", "comment": null}, "daily_budget_currency_code": {"type": "text", "index": 15, "name": "daily_budget_currency_code", "comment": null}, "unit_cost_amount": {"type": "double precision", "index": 16, "name": "unit_cost_amount", "comment": null}, "unit_cost_currency_code": {"type": "text", "index": 17, "name": "unit_cost_currency_code", "comment": null}, "currency": {"type": "text", "index": 18, "name": "currency", "comment": null}, "format": {"type": "text", "index": 19, "name": "format", "comment": null}, "locale_country": {"type": "text", "index": 20, "name": "locale_country", "comment": null}, "locale_language": {"type": "text", "index": 21, "name": "locale_language", "comment": null}, "objective_type": {"type": "text", "index": 22, "name": "objective_type", "comment": null}, "optimization_target_type": {"type": "text", "index": 23, "name": "optimization_target_type", "comment": null}, "is_audience_expansion_enabled": {"type": "boolean", "index": 24, "name": "is_audience_expansion_enabled", "comment": null}, "is_offsite_delivery_enabled": {"type": "boolean", "index": 25, "name": "is_offsite_delivery_enabled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 26, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 27, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 28, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 29, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 30, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 31, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 32, "name": "cost", "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.linkedin.linkedin_ads__campaign_report"}, "model.linkedin.linkedin_ads__creative_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__creative_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "creative_id": {"type": "integer", "index": 2, "name": "creative_id", "comment": null}, "version_tag": {"type": "numeric", "index": 3, "name": "version_tag", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 5, "name": "campaign_name", "comment": null}, "campaign_group_id": {"type": "integer", "index": 6, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 7, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 8, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 9, "name": "account_name", "comment": null}, "type": {"type": "text", "index": 10, "name": "type", "comment": null}, "click_uri": {"type": "character varying", "index": 11, "name": "click_uri", "comment": null}, "creative_status": {"type": "text", "index": 12, "name": "creative_status", "comment": null}, "campaign_status": {"type": "text", "index": 13, "name": "campaign_status", "comment": null}, "campaign_group_status": {"type": "text", "index": 14, "name": "campaign_group_status", "comment": null}, "call_to_action_label_type": {"type": "text", "index": 15, "name": "call_to_action_label_type", "comment": null}, "currency": {"type": "text", "index": 16, "name": "currency", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 17, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 18, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 19, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 20, "name": "impressions", "comment": null}, "cost": {"type": "bigint", "index": 21, "name": "cost", "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.linkedin.linkedin_ads__creative_report"}, "model.linkedin.linkedin_ads__url_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__url_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "click_uri": {"type": "character varying", "index": 2, "name": "click_uri", "comment": null}, "base_url": {"type": "text", "index": 3, "name": "base_url", "comment": null}, "url_host": {"type": "text", "index": 4, "name": "url_host", "comment": null}, "url_path": {"type": "text", "index": 5, "name": "url_path", "comment": null}, "utm_source": {"type": "text", "index": 6, "name": "utm_source", "comment": null}, "utm_medium": {"type": "text", "index": 7, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "text", "index": 8, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "text", "index": 9, "name": "utm_content", "comment": null}, "utm_term": {"type": "text", "index": 10, "name": "utm_term", "comment": null}, "creative_id": {"type": "integer", "index": 11, "name": "creative_id", "comment": null}, "version_tag": {"type": "numeric", "index": 12, "name": "version_tag", "comment": null}, "campaign_id": {"type": "integer", "index": 13, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 14, "name": "campaign_name", "comment": null}, "campaign_group_id": {"type": "integer", "index": 15, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 16, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 17, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 18, "name": "account_name", "comment": null}, "currency": {"type": "text", "index": 19, "name": "currency", "comment": null}, "clicks": {"type": "bigint", "index": 20, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 21, "name": "impressions", "comment": null}, "cost": {"type": "bigint", "index": 22, "name": "cost", "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.linkedin.linkedin_ads__url_report"}, "model.linkedin_source.stg_linkedin_ads__account_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__account_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_id": {"type": "integer", "index": 1, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 2, "name": "account_name", "comment": null}, "currency": {"type": "text", "index": 3, "name": "currency", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 5, "name": "status", "comment": null}, "type": {"type": "text", "index": 6, "name": "type", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 7, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 9, "name": "is_latest_version", "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.linkedin_source.stg_linkedin_ads__account_history"}, "model.linkedin_source.stg_linkedin_ads__account_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__account_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "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.linkedin_source.stg_linkedin_ads__account_history_tmp"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_campaign", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 5, "name": "cost", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_campaign_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "_fivetran_synced": {"type": "text", "index": 3, "name": "_fivetran_synced", "comment": null}, "action_clicks": {"type": "integer", "index": 4, "name": "action_clicks", "comment": null}, "ad_unit_clicks": {"type": "integer", "index": 5, "name": "ad_unit_clicks", "comment": null}, "approximate_unique_impressions": {"type": "integer", "index": 6, "name": "approximate_unique_impressions", "comment": null}, "card_clicks": {"type": "integer", "index": 7, "name": "card_clicks", "comment": null}, "card_impressions": {"type": "integer", "index": 8, "name": "card_impressions", "comment": null}, "clicks": {"type": "integer", "index": 9, "name": "clicks", "comment": null}, "comment_likes": {"type": "integer", "index": 10, "name": "comment_likes", "comment": null}, "comments": {"type": "integer", "index": 11, "name": "comments", "comment": null}, "company_page_clicks": {"type": "integer", "index": 12, "name": "company_page_clicks", "comment": null}, "conversion_value_in_local_currency": {"type": "integer", "index": 13, "name": "conversion_value_in_local_currency", "comment": null}, "cost_in_local_currency": {"type": "double precision", "index": 14, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "double precision", "index": 15, "name": "cost_in_usd", "comment": null}, "external_website_conversions": {"type": "integer", "index": 16, "name": "external_website_conversions", "comment": null}, "external_website_post_click_conversions": {"type": "integer", "index": 17, "name": "external_website_post_click_conversions", "comment": null}, "external_website_post_view_conversions": {"type": "integer", "index": 18, "name": "external_website_post_view_conversions", "comment": null}, "follows": {"type": "integer", "index": 19, "name": "follows", "comment": null}, "full_screen_plays": {"type": "integer", "index": 20, "name": "full_screen_plays", "comment": null}, "impressions": {"type": "integer", "index": 21, "name": "impressions", "comment": null}, "landing_page_clicks": {"type": "integer", "index": 22, "name": "landing_page_clicks", "comment": null}, "lead_generation_mail_contact_info_shares": {"type": "integer", "index": 23, "name": "lead_generation_mail_contact_info_shares", "comment": null}, "lead_generation_mail_interested_clicks": {"type": "integer", "index": 24, "name": "lead_generation_mail_interested_clicks", "comment": null}, "likes": {"type": "integer", "index": 25, "name": "likes", "comment": null}, "one_click_lead_form_opens": {"type": "integer", "index": 26, "name": "one_click_lead_form_opens", "comment": null}, "one_click_leads": {"type": "integer", "index": 27, "name": "one_click_leads", "comment": null}, "opens": {"type": "integer", "index": 28, "name": "opens", "comment": null}, "other_engagements": {"type": "integer", "index": 29, "name": "other_engagements", "comment": null}, "shares": {"type": "integer", "index": 30, "name": "shares", "comment": null}, "text_url_clicks": {"type": "integer", "index": 31, "name": "text_url_clicks", "comment": null}, "total_engagements": {"type": "integer", "index": 32, "name": "total_engagements", "comment": null}, "video_completions": {"type": "integer", "index": 33, "name": "video_completions", "comment": null}, "video_first_quartile_completions": {"type": "integer", "index": 34, "name": "video_first_quartile_completions", "comment": null}, "video_midpoint_completions": {"type": "integer", "index": 35, "name": "video_midpoint_completions", "comment": null}, "video_starts": {"type": "integer", "index": 36, "name": "video_starts", "comment": null}, "video_third_quartile_completions": {"type": "integer", "index": 37, "name": "video_third_quartile_completions", "comment": null}, "video_views": {"type": "integer", "index": 38, "name": "video_views", "comment": null}, "viral_card_clicks": {"type": "integer", "index": 39, "name": "viral_card_clicks", "comment": null}, "viral_card_impressions": {"type": "integer", "index": 40, "name": "viral_card_impressions", "comment": null}, "viral_clicks": {"type": "integer", "index": 41, "name": "viral_clicks", "comment": null}, "viral_comment_likes": {"type": "integer", "index": 42, "name": "viral_comment_likes", "comment": null}, "viral_comments": {"type": "integer", "index": 43, "name": "viral_comments", "comment": null}, "viral_company_page_clicks": {"type": "integer", "index": 44, "name": "viral_company_page_clicks", "comment": null}, "viral_external_website_conversions": {"type": "integer", "index": 45, "name": "viral_external_website_conversions", "comment": null}, "viral_external_website_post_click_conversions": {"type": "integer", "index": 46, "name": "viral_external_website_post_click_conversions", "comment": null}, "viral_external_website_post_view_conversions": {"type": "integer", "index": 47, "name": "viral_external_website_post_view_conversions", "comment": null}, "viral_follows": {"type": "integer", "index": 48, "name": "viral_follows", "comment": null}, "viral_full_screen_plays": {"type": "integer", "index": 49, "name": "viral_full_screen_plays", "comment": null}, "viral_impressions": {"type": "integer", "index": 50, "name": "viral_impressions", "comment": null}, "viral_landing_page_clicks": {"type": "integer", "index": 51, "name": "viral_landing_page_clicks", "comment": null}, "viral_likes": {"type": "integer", "index": 52, "name": "viral_likes", "comment": null}, "viral_one_click_lead_form_opens": {"type": "integer", "index": 53, "name": "viral_one_click_lead_form_opens", "comment": null}, "viral_one_click_leads": {"type": "integer", "index": 54, "name": "viral_one_click_leads", "comment": null}, "viral_other_engagements": {"type": "integer", "index": 55, "name": "viral_other_engagements", "comment": null}, "viral_shares": {"type": "integer", "index": 56, "name": "viral_shares", "comment": null}, "viral_total_engagements": {"type": "integer", "index": 57, "name": "viral_total_engagements", "comment": null}, "viral_video_completions": {"type": "integer", "index": 58, "name": "viral_video_completions", "comment": null}, "viral_video_first_quartile_completions": {"type": "integer", "index": 59, "name": "viral_video_first_quartile_completions", "comment": null}, "viral_video_midpoint_completions": {"type": "integer", "index": 60, "name": "viral_video_midpoint_completions", "comment": null}, "viral_video_starts": {"type": "integer", "index": 61, "name": "viral_video_starts", "comment": null}, "viral_video_third_quartile_completions": {"type": "integer", "index": 62, "name": "viral_video_third_quartile_completions", "comment": null}, "viral_video_views": {"type": "integer", "index": 63, "name": "viral_video_views", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_creative", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "creative_id": {"type": "integer", "index": 2, "name": "creative_id", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost": {"type": "integer", "index": 5, "name": "cost", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_creative_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"creative_id": {"type": "integer", "index": 1, "name": "creative_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost_in_local_currency": {"type": "integer", "index": 5, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "integer", "index": 6, "name": "cost_in_usd", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_group_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_group_id": {"type": "integer", "index": 1, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 2, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "status": {"type": "text", "index": 4, "name": "status", "comment": null}, "is_backfilled": {"type": "boolean", "index": 5, "name": "is_backfilled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 6, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 7, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 10, "name": "is_latest_version", "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.linkedin_source.stg_linkedin_ads__campaign_group_history"}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_group_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 4, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"}, "model.linkedin_source.stg_linkedin_ads__campaign_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 2, "name": "campaign_name", "comment": null}, "version_tag": {"type": "numeric", "index": 3, "name": "version_tag", "comment": null}, "campaign_group_id": {"type": "integer", "index": 4, "name": "campaign_group_id", "comment": null}, "account_id": {"type": "integer", "index": 5, "name": "account_id", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "type": {"type": "text", "index": 7, "name": "type", "comment": null}, "cost_type": {"type": "text", "index": 8, "name": "cost_type", "comment": null}, "creative_selection": {"type": "text", "index": 9, "name": "creative_selection", "comment": null}, "daily_budget_amount": {"type": "double precision", "index": 10, "name": "daily_budget_amount", "comment": null}, "daily_budget_currency_code": {"type": "text", "index": 11, "name": "daily_budget_currency_code", "comment": null}, "unit_cost_amount": {"type": "double precision", "index": 12, "name": "unit_cost_amount", "comment": null}, "unit_cost_currency_code": {"type": "text", "index": 13, "name": "unit_cost_currency_code", "comment": null}, "format": {"type": "text", "index": 14, "name": "format", "comment": null}, "locale_country": {"type": "text", "index": 15, "name": "locale_country", "comment": null}, "locale_language": {"type": "text", "index": 16, "name": "locale_language", "comment": null}, "objective_type": {"type": "text", "index": 17, "name": "objective_type", "comment": null}, "optimization_target_type": {"type": "text", "index": 18, "name": "optimization_target_type", "comment": null}, "is_audience_expansion_enabled": {"type": "boolean", "index": 19, "name": "is_audience_expansion_enabled", "comment": null}, "is_offsite_delivery_enabled": {"type": "boolean", "index": 20, "name": "is_offsite_delivery_enabled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 21, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 22, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 23, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 24, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 25, "name": "is_latest_version", "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.linkedin_source.stg_linkedin_ads__campaign_history"}, "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "campaign_group_id": {"type": "integer", "index": 4, "name": "campaign_group_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 5, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "version_tag": {"type": "integer", "index": 7, "name": "version_tag", "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.linkedin_source.stg_linkedin_ads__campaign_history_tmp"}, "model.linkedin_source.stg_linkedin_ads__creative_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__creative_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"creative_id": {"type": "integer", "index": 1, "name": "creative_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "type": {"type": "text", "index": 3, "name": "type", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 5, "name": "status", "comment": null}, "click_uri": {"type": "character varying", "index": 6, "name": "click_uri", "comment": null}, "call_to_action_label_type": {"type": "text", "index": 7, "name": "call_to_action_label_type", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 10, "name": "is_latest_version", "comment": null}, "base_url": {"type": "text", "index": 11, "name": "base_url", "comment": null}, "url_host": {"type": "text", "index": 12, "name": "url_host", "comment": null}, "url_path": {"type": "text", "index": 13, "name": "url_path", "comment": null}, "utm_source": {"type": "text", "index": 14, "name": "utm_source", "comment": null}, "utm_medium": {"type": "text", "index": 15, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "text", "index": 16, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "text", "index": 17, "name": "utm_content", "comment": null}, "utm_term": {"type": "text", "index": 18, "name": "utm_term", "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.linkedin_source.stg_linkedin_ads__creative_history"}, "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__creative_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}, "click_uri": {"type": "character varying", "index": 8, "name": "click_uri", "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.linkedin_source.stg_linkedin_ads__creative_history_tmp"}}, "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": "2023-01-09T15:29:09.159664Z", "invocation_id": "413e08a3-98c2-41ac-8950-bf784e480296", "env": {}}, "nodes": {"seed.linkedin_integration_tests.linkedin_account_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_account_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "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.linkedin_integration_tests.linkedin_account_history_data"}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_ad_analytics_by_campaign_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "_fivetran_synced": {"type": "text", "index": 3, "name": "_fivetran_synced", "comment": null}, "action_clicks": {"type": "integer", "index": 4, "name": "action_clicks", "comment": null}, "ad_unit_clicks": {"type": "integer", "index": 5, "name": "ad_unit_clicks", "comment": null}, "approximate_unique_impressions": {"type": "integer", "index": 6, "name": "approximate_unique_impressions", "comment": null}, "card_clicks": {"type": "integer", "index": 7, "name": "card_clicks", "comment": null}, "card_impressions": {"type": "integer", "index": 8, "name": "card_impressions", "comment": null}, "clicks": {"type": "integer", "index": 9, "name": "clicks", "comment": null}, "comment_likes": {"type": "integer", "index": 10, "name": "comment_likes", "comment": null}, "comments": {"type": "integer", "index": 11, "name": "comments", "comment": null}, "company_page_clicks": {"type": "integer", "index": 12, "name": "company_page_clicks", "comment": null}, "conversion_value_in_local_currency": {"type": "integer", "index": 13, "name": "conversion_value_in_local_currency", "comment": null}, "cost_in_local_currency": {"type": "double precision", "index": 14, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "double precision", "index": 15, "name": "cost_in_usd", "comment": null}, "external_website_conversions": {"type": "integer", "index": 16, "name": "external_website_conversions", "comment": null}, "external_website_post_click_conversions": {"type": "integer", "index": 17, "name": "external_website_post_click_conversions", "comment": null}, "external_website_post_view_conversions": {"type": "integer", "index": 18, "name": "external_website_post_view_conversions", "comment": null}, "follows": {"type": "integer", "index": 19, "name": "follows", "comment": null}, "full_screen_plays": {"type": "integer", "index": 20, "name": "full_screen_plays", "comment": null}, "impressions": {"type": "integer", "index": 21, "name": "impressions", "comment": null}, "landing_page_clicks": {"type": "integer", "index": 22, "name": "landing_page_clicks", "comment": null}, "lead_generation_mail_contact_info_shares": {"type": "integer", "index": 23, "name": "lead_generation_mail_contact_info_shares", "comment": null}, "lead_generation_mail_interested_clicks": {"type": "integer", "index": 24, "name": "lead_generation_mail_interested_clicks", "comment": null}, "likes": {"type": "integer", "index": 25, "name": "likes", "comment": null}, "one_click_lead_form_opens": {"type": "integer", "index": 26, "name": "one_click_lead_form_opens", "comment": null}, "one_click_leads": {"type": "integer", "index": 27, "name": "one_click_leads", "comment": null}, "opens": {"type": "integer", "index": 28, "name": "opens", "comment": null}, "other_engagements": {"type": "integer", "index": 29, "name": "other_engagements", "comment": null}, "shares": {"type": "integer", "index": 30, "name": "shares", "comment": null}, "text_url_clicks": {"type": "integer", "index": 31, "name": "text_url_clicks", "comment": null}, "total_engagements": {"type": "integer", "index": 32, "name": "total_engagements", "comment": null}, "video_completions": {"type": "integer", "index": 33, "name": "video_completions", "comment": null}, "video_first_quartile_completions": {"type": "integer", "index": 34, "name": "video_first_quartile_completions", "comment": null}, "video_midpoint_completions": {"type": "integer", "index": 35, "name": "video_midpoint_completions", "comment": null}, "video_starts": {"type": "integer", "index": 36, "name": "video_starts", "comment": null}, "video_third_quartile_completions": {"type": "integer", "index": 37, "name": "video_third_quartile_completions", "comment": null}, "video_views": {"type": "integer", "index": 38, "name": "video_views", "comment": null}, "viral_card_clicks": {"type": "integer", "index": 39, "name": "viral_card_clicks", "comment": null}, "viral_card_impressions": {"type": "integer", "index": 40, "name": "viral_card_impressions", "comment": null}, "viral_clicks": {"type": "integer", "index": 41, "name": "viral_clicks", "comment": null}, "viral_comment_likes": {"type": "integer", "index": 42, "name": "viral_comment_likes", "comment": null}, "viral_comments": {"type": "integer", "index": 43, "name": "viral_comments", "comment": null}, "viral_company_page_clicks": {"type": "integer", "index": 44, "name": "viral_company_page_clicks", "comment": null}, "viral_external_website_conversions": {"type": "integer", "index": 45, "name": "viral_external_website_conversions", "comment": null}, "viral_external_website_post_click_conversions": {"type": "integer", "index": 46, "name": "viral_external_website_post_click_conversions", "comment": null}, "viral_external_website_post_view_conversions": {"type": "integer", "index": 47, "name": "viral_external_website_post_view_conversions", "comment": null}, "viral_follows": {"type": "integer", "index": 48, "name": "viral_follows", "comment": null}, "viral_full_screen_plays": {"type": "integer", "index": 49, "name": "viral_full_screen_plays", "comment": null}, "viral_impressions": {"type": "integer", "index": 50, "name": "viral_impressions", "comment": null}, "viral_landing_page_clicks": {"type": "integer", "index": 51, "name": "viral_landing_page_clicks", "comment": null}, "viral_likes": {"type": "integer", "index": 52, "name": "viral_likes", "comment": null}, "viral_one_click_lead_form_opens": {"type": "integer", "index": 53, "name": "viral_one_click_lead_form_opens", "comment": null}, "viral_one_click_leads": {"type": "integer", "index": 54, "name": "viral_one_click_leads", "comment": null}, "viral_other_engagements": {"type": "integer", "index": 55, "name": "viral_other_engagements", "comment": null}, "viral_shares": {"type": "integer", "index": 56, "name": "viral_shares", "comment": null}, "viral_total_engagements": {"type": "integer", "index": 57, "name": "viral_total_engagements", "comment": null}, "viral_video_completions": {"type": "integer", "index": 58, "name": "viral_video_completions", "comment": null}, "viral_video_first_quartile_completions": {"type": "integer", "index": 59, "name": "viral_video_first_quartile_completions", "comment": null}, "viral_video_midpoint_completions": {"type": "integer", "index": 60, "name": "viral_video_midpoint_completions", "comment": null}, "viral_video_starts": {"type": "integer", "index": 61, "name": "viral_video_starts", "comment": null}, "viral_video_third_quartile_completions": {"type": "integer", "index": 62, "name": "viral_video_third_quartile_completions", "comment": null}, "viral_video_views": {"type": "integer", "index": 63, "name": "viral_video_views", "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.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_ad_analytics_by_creative_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"creative_id": {"type": "integer", "index": 1, "name": "creative_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost_in_local_currency": {"type": "integer", "index": 5, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "integer", "index": 6, "name": "cost_in_usd", "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.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"}, "seed.linkedin_integration_tests.linkedin_campaign_group_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_campaign_group_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 4, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_group_history_data"}, "seed.linkedin_integration_tests.linkedin_campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_campaign_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "campaign_group_id": {"type": "integer", "index": 4, "name": "campaign_group_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 5, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "version_tag": {"type": "integer", "index": 7, "name": "version_tag", "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.linkedin_integration_tests.linkedin_campaign_history_data"}, "seed.linkedin_integration_tests.linkedin_creative_history_data": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2", "name": "linkedin_creative_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}, "click_uri": {"type": "character varying", "index": 8, "name": "click_uri", "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.linkedin_integration_tests.linkedin_creative_history_data"}, "model.linkedin.linkedin_ads__account_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__account_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "account_id": {"type": "integer", "index": 2, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 3, "name": "account_name", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "type": {"type": "text", "index": 7, "name": "type", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 10, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 11, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 12, "name": "cost", "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.linkedin.linkedin_ads__account_report"}, "model.linkedin.linkedin_ads__campaign_group_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__campaign_group_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "campaign_group_id": {"type": "integer", "index": 2, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 3, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 5, "name": "account_name", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "currency": {"type": "text", "index": 7, "name": "currency", "comment": null}, "is_backfilled": {"type": "boolean", "index": 8, "name": "is_backfilled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 9, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 10, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 11, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 13, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 14, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 15, "name": "cost", "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.linkedin.linkedin_ads__campaign_group_report"}, "model.linkedin.linkedin_ads__campaign_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__campaign_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "campaign_group_id": {"type": "integer", "index": 5, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 6, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 7, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 8, "name": "account_name", "comment": null}, "campaign_status": {"type": "text", "index": 9, "name": "campaign_status", "comment": null}, "campaign_group_status": {"type": "text", "index": 10, "name": "campaign_group_status", "comment": null}, "type": {"type": "text", "index": 11, "name": "type", "comment": null}, "cost_type": {"type": "text", "index": 12, "name": "cost_type", "comment": null}, "creative_selection": {"type": "text", "index": 13, "name": "creative_selection", "comment": null}, "daily_budget_amount": {"type": "double precision", "index": 14, "name": "daily_budget_amount", "comment": null}, "daily_budget_currency_code": {"type": "text", "index": 15, "name": "daily_budget_currency_code", "comment": null}, "unit_cost_amount": {"type": "double precision", "index": 16, "name": "unit_cost_amount", "comment": null}, "unit_cost_currency_code": {"type": "text", "index": 17, "name": "unit_cost_currency_code", "comment": null}, "currency": {"type": "text", "index": 18, "name": "currency", "comment": null}, "format": {"type": "text", "index": 19, "name": "format", "comment": null}, "locale_country": {"type": "text", "index": 20, "name": "locale_country", "comment": null}, "locale_language": {"type": "text", "index": 21, "name": "locale_language", "comment": null}, "objective_type": {"type": "text", "index": 22, "name": "objective_type", "comment": null}, "optimization_target_type": {"type": "text", "index": 23, "name": "optimization_target_type", "comment": null}, "is_audience_expansion_enabled": {"type": "boolean", "index": 24, "name": "is_audience_expansion_enabled", "comment": null}, "is_offsite_delivery_enabled": {"type": "boolean", "index": 25, "name": "is_offsite_delivery_enabled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 26, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 27, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 28, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 29, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 30, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 31, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 32, "name": "cost", "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.linkedin.linkedin_ads__campaign_report"}, "model.linkedin.linkedin_ads__creative_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__creative_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "creative_id": {"type": "integer", "index": 2, "name": "creative_id", "comment": null}, "version_tag": {"type": "numeric", "index": 3, "name": "version_tag", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 5, "name": "campaign_name", "comment": null}, "campaign_group_id": {"type": "integer", "index": 6, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 7, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 8, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 9, "name": "account_name", "comment": null}, "type": {"type": "text", "index": 10, "name": "type", "comment": null}, "click_uri": {"type": "character varying", "index": 11, "name": "click_uri", "comment": null}, "creative_status": {"type": "text", "index": 12, "name": "creative_status", "comment": null}, "campaign_status": {"type": "text", "index": 13, "name": "campaign_status", "comment": null}, "campaign_group_status": {"type": "text", "index": 14, "name": "campaign_group_status", "comment": null}, "call_to_action_label_type": {"type": "text", "index": 15, "name": "call_to_action_label_type", "comment": null}, "currency": {"type": "text", "index": 16, "name": "currency", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 17, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 18, "name": "created_at", "comment": null}, "clicks": {"type": "bigint", "index": 19, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 20, "name": "impressions", "comment": null}, "cost": {"type": "bigint", "index": 21, "name": "cost", "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.linkedin.linkedin_ads__creative_report"}, "model.linkedin.linkedin_ads__url_report": {"metadata": {"type": "BASE TABLE", "schema": "linkedin_integration_tests_2_linkedin_ads", "name": "linkedin_ads__url_report", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "click_uri": {"type": "character varying", "index": 2, "name": "click_uri", "comment": null}, "base_url": {"type": "text", "index": 3, "name": "base_url", "comment": null}, "url_host": {"type": "text", "index": 4, "name": "url_host", "comment": null}, "url_path": {"type": "text", "index": 5, "name": "url_path", "comment": null}, "utm_source": {"type": "text", "index": 6, "name": "utm_source", "comment": null}, "utm_medium": {"type": "text", "index": 7, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "text", "index": 8, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "text", "index": 9, "name": "utm_content", "comment": null}, "utm_term": {"type": "text", "index": 10, "name": "utm_term", "comment": null}, "creative_id": {"type": "integer", "index": 11, "name": "creative_id", "comment": null}, "version_tag": {"type": "numeric", "index": 12, "name": "version_tag", "comment": null}, "campaign_id": {"type": "integer", "index": 13, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 14, "name": "campaign_name", "comment": null}, "campaign_group_id": {"type": "integer", "index": 15, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 16, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 17, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 18, "name": "account_name", "comment": null}, "currency": {"type": "text", "index": 19, "name": "currency", "comment": null}, "clicks": {"type": "bigint", "index": 20, "name": "clicks", "comment": null}, "impressions": {"type": "bigint", "index": 21, "name": "impressions", "comment": null}, "cost": {"type": "bigint", "index": 22, "name": "cost", "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.linkedin.linkedin_ads__url_report"}, "model.linkedin_source.stg_linkedin_ads__account_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__account_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_id": {"type": "integer", "index": 1, "name": "account_id", "comment": null}, "account_name": {"type": "text", "index": 2, "name": "account_name", "comment": null}, "currency": {"type": "text", "index": 3, "name": "currency", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 5, "name": "status", "comment": null}, "type": {"type": "text", "index": 6, "name": "type", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 7, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 9, "name": "is_latest_version", "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.linkedin_source.stg_linkedin_ads__account_history"}, "model.linkedin_source.stg_linkedin_ads__account_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__account_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "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.linkedin_source.stg_linkedin_ads__account_history_tmp"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_campaign", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost": {"type": "double precision", "index": 5, "name": "cost", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_campaign_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "_fivetran_synced": {"type": "text", "index": 3, "name": "_fivetran_synced", "comment": null}, "action_clicks": {"type": "integer", "index": 4, "name": "action_clicks", "comment": null}, "ad_unit_clicks": {"type": "integer", "index": 5, "name": "ad_unit_clicks", "comment": null}, "approximate_unique_impressions": {"type": "integer", "index": 6, "name": "approximate_unique_impressions", "comment": null}, "card_clicks": {"type": "integer", "index": 7, "name": "card_clicks", "comment": null}, "card_impressions": {"type": "integer", "index": 8, "name": "card_impressions", "comment": null}, "clicks": {"type": "integer", "index": 9, "name": "clicks", "comment": null}, "comment_likes": {"type": "integer", "index": 10, "name": "comment_likes", "comment": null}, "comments": {"type": "integer", "index": 11, "name": "comments", "comment": null}, "company_page_clicks": {"type": "integer", "index": 12, "name": "company_page_clicks", "comment": null}, "conversion_value_in_local_currency": {"type": "integer", "index": 13, "name": "conversion_value_in_local_currency", "comment": null}, "cost_in_local_currency": {"type": "double precision", "index": 14, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "double precision", "index": 15, "name": "cost_in_usd", "comment": null}, "external_website_conversions": {"type": "integer", "index": 16, "name": "external_website_conversions", "comment": null}, "external_website_post_click_conversions": {"type": "integer", "index": 17, "name": "external_website_post_click_conversions", "comment": null}, "external_website_post_view_conversions": {"type": "integer", "index": 18, "name": "external_website_post_view_conversions", "comment": null}, "follows": {"type": "integer", "index": 19, "name": "follows", "comment": null}, "full_screen_plays": {"type": "integer", "index": 20, "name": "full_screen_plays", "comment": null}, "impressions": {"type": "integer", "index": 21, "name": "impressions", "comment": null}, "landing_page_clicks": {"type": "integer", "index": 22, "name": "landing_page_clicks", "comment": null}, "lead_generation_mail_contact_info_shares": {"type": "integer", "index": 23, "name": "lead_generation_mail_contact_info_shares", "comment": null}, "lead_generation_mail_interested_clicks": {"type": "integer", "index": 24, "name": "lead_generation_mail_interested_clicks", "comment": null}, "likes": {"type": "integer", "index": 25, "name": "likes", "comment": null}, "one_click_lead_form_opens": {"type": "integer", "index": 26, "name": "one_click_lead_form_opens", "comment": null}, "one_click_leads": {"type": "integer", "index": 27, "name": "one_click_leads", "comment": null}, "opens": {"type": "integer", "index": 28, "name": "opens", "comment": null}, "other_engagements": {"type": "integer", "index": 29, "name": "other_engagements", "comment": null}, "shares": {"type": "integer", "index": 30, "name": "shares", "comment": null}, "text_url_clicks": {"type": "integer", "index": 31, "name": "text_url_clicks", "comment": null}, "total_engagements": {"type": "integer", "index": 32, "name": "total_engagements", "comment": null}, "video_completions": {"type": "integer", "index": 33, "name": "video_completions", "comment": null}, "video_first_quartile_completions": {"type": "integer", "index": 34, "name": "video_first_quartile_completions", "comment": null}, "video_midpoint_completions": {"type": "integer", "index": 35, "name": "video_midpoint_completions", "comment": null}, "video_starts": {"type": "integer", "index": 36, "name": "video_starts", "comment": null}, "video_third_quartile_completions": {"type": "integer", "index": 37, "name": "video_third_quartile_completions", "comment": null}, "video_views": {"type": "integer", "index": 38, "name": "video_views", "comment": null}, "viral_card_clicks": {"type": "integer", "index": 39, "name": "viral_card_clicks", "comment": null}, "viral_card_impressions": {"type": "integer", "index": 40, "name": "viral_card_impressions", "comment": null}, "viral_clicks": {"type": "integer", "index": 41, "name": "viral_clicks", "comment": null}, "viral_comment_likes": {"type": "integer", "index": 42, "name": "viral_comment_likes", "comment": null}, "viral_comments": {"type": "integer", "index": 43, "name": "viral_comments", "comment": null}, "viral_company_page_clicks": {"type": "integer", "index": 44, "name": "viral_company_page_clicks", "comment": null}, "viral_external_website_conversions": {"type": "integer", "index": 45, "name": "viral_external_website_conversions", "comment": null}, "viral_external_website_post_click_conversions": {"type": "integer", "index": 46, "name": "viral_external_website_post_click_conversions", "comment": null}, "viral_external_website_post_view_conversions": {"type": "integer", "index": 47, "name": "viral_external_website_post_view_conversions", "comment": null}, "viral_follows": {"type": "integer", "index": 48, "name": "viral_follows", "comment": null}, "viral_full_screen_plays": {"type": "integer", "index": 49, "name": "viral_full_screen_plays", "comment": null}, "viral_impressions": {"type": "integer", "index": 50, "name": "viral_impressions", "comment": null}, "viral_landing_page_clicks": {"type": "integer", "index": 51, "name": "viral_landing_page_clicks", "comment": null}, "viral_likes": {"type": "integer", "index": 52, "name": "viral_likes", "comment": null}, "viral_one_click_lead_form_opens": {"type": "integer", "index": 53, "name": "viral_one_click_lead_form_opens", "comment": null}, "viral_one_click_leads": {"type": "integer", "index": 54, "name": "viral_one_click_leads", "comment": null}, "viral_other_engagements": {"type": "integer", "index": 55, "name": "viral_other_engagements", "comment": null}, "viral_shares": {"type": "integer", "index": 56, "name": "viral_shares", "comment": null}, "viral_total_engagements": {"type": "integer", "index": 57, "name": "viral_total_engagements", "comment": null}, "viral_video_completions": {"type": "integer", "index": 58, "name": "viral_video_completions", "comment": null}, "viral_video_first_quartile_completions": {"type": "integer", "index": 59, "name": "viral_video_first_quartile_completions", "comment": null}, "viral_video_midpoint_completions": {"type": "integer", "index": 60, "name": "viral_video_midpoint_completions", "comment": null}, "viral_video_starts": {"type": "integer", "index": 61, "name": "viral_video_starts", "comment": null}, "viral_video_third_quartile_completions": {"type": "integer", "index": 62, "name": "viral_video_third_quartile_completions", "comment": null}, "viral_video_views": {"type": "integer", "index": 63, "name": "viral_video_views", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_creative", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "creative_id": {"type": "integer", "index": 2, "name": "creative_id", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost": {"type": "integer", "index": 5, "name": "cost", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__ad_analytics_by_creative_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"creative_id": {"type": "integer", "index": 1, "name": "creative_id", "comment": null}, "day": {"type": "timestamp without time zone", "index": 2, "name": "day", "comment": null}, "clicks": {"type": "integer", "index": 3, "name": "clicks", "comment": null}, "impressions": {"type": "integer", "index": 4, "name": "impressions", "comment": null}, "cost_in_local_currency": {"type": "integer", "index": 5, "name": "cost_in_local_currency", "comment": null}, "cost_in_usd": {"type": "integer", "index": 6, "name": "cost_in_usd", "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_group_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_group_id": {"type": "integer", "index": 1, "name": "campaign_group_id", "comment": null}, "campaign_group_name": {"type": "text", "index": 2, "name": "campaign_group_name", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "status": {"type": "text", "index": 4, "name": "status", "comment": null}, "is_backfilled": {"type": "boolean", "index": 5, "name": "is_backfilled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 6, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 7, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 10, "name": "is_latest_version", "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.linkedin_source.stg_linkedin_ads__campaign_group_history"}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_group_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 4, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"}, "model.linkedin_source.stg_linkedin_ads__campaign_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 2, "name": "campaign_name", "comment": null}, "version_tag": {"type": "numeric", "index": 3, "name": "version_tag", "comment": null}, "campaign_group_id": {"type": "integer", "index": 4, "name": "campaign_group_id", "comment": null}, "account_id": {"type": "integer", "index": 5, "name": "account_id", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "type": {"type": "text", "index": 7, "name": "type", "comment": null}, "cost_type": {"type": "text", "index": 8, "name": "cost_type", "comment": null}, "creative_selection": {"type": "text", "index": 9, "name": "creative_selection", "comment": null}, "daily_budget_amount": {"type": "double precision", "index": 10, "name": "daily_budget_amount", "comment": null}, "daily_budget_currency_code": {"type": "text", "index": 11, "name": "daily_budget_currency_code", "comment": null}, "unit_cost_amount": {"type": "double precision", "index": 12, "name": "unit_cost_amount", "comment": null}, "unit_cost_currency_code": {"type": "text", "index": 13, "name": "unit_cost_currency_code", "comment": null}, "format": {"type": "text", "index": 14, "name": "format", "comment": null}, "locale_country": {"type": "text", "index": 15, "name": "locale_country", "comment": null}, "locale_language": {"type": "text", "index": 16, "name": "locale_language", "comment": null}, "objective_type": {"type": "text", "index": 17, "name": "objective_type", "comment": null}, "optimization_target_type": {"type": "text", "index": 18, "name": "optimization_target_type", "comment": null}, "is_audience_expansion_enabled": {"type": "boolean", "index": 19, "name": "is_audience_expansion_enabled", "comment": null}, "is_offsite_delivery_enabled": {"type": "boolean", "index": 20, "name": "is_offsite_delivery_enabled", "comment": null}, "run_schedule_start_at": {"type": "timestamp without time zone", "index": 21, "name": "run_schedule_start_at", "comment": null}, "run_schedule_end_at": {"type": "timestamp without time zone", "index": 22, "name": "run_schedule_end_at", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 23, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 24, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 25, "name": "is_latest_version", "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.linkedin_source.stg_linkedin_ads__campaign_history"}, "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "account_id": {"type": "integer", "index": 3, "name": "account_id", "comment": null}, "campaign_group_id": {"type": "integer", "index": 4, "name": "campaign_group_id", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 5, "name": "created_time", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "version_tag": {"type": "integer", "index": 7, "name": "version_tag", "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.linkedin_source.stg_linkedin_ads__campaign_history_tmp"}, "model.linkedin_source.stg_linkedin_ads__creative_history": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__creative_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"creative_id": {"type": "integer", "index": 1, "name": "creative_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "type": {"type": "text", "index": 3, "name": "type", "comment": null}, "version_tag": {"type": "numeric", "index": 4, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 5, "name": "status", "comment": null}, "click_uri": {"type": "character varying", "index": 6, "name": "click_uri", "comment": null}, "call_to_action_label_type": {"type": "text", "index": 7, "name": "call_to_action_label_type", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "is_latest_version": {"type": "boolean", "index": 10, "name": "is_latest_version", "comment": null}, "base_url": {"type": "text", "index": 11, "name": "base_url", "comment": null}, "url_host": {"type": "text", "index": 12, "name": "url_host", "comment": null}, "url_path": {"type": "text", "index": 13, "name": "url_path", "comment": null}, "utm_source": {"type": "text", "index": 14, "name": "utm_source", "comment": null}, "utm_medium": {"type": "text", "index": 15, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "text", "index": 16, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "text", "index": 17, "name": "utm_content", "comment": null}, "utm_term": {"type": "text", "index": 18, "name": "utm_term", "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.linkedin_source.stg_linkedin_ads__creative_history"}, "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": {"metadata": {"type": "VIEW", "schema": "linkedin_integration_tests_2_linkedin_ads_source", "name": "stg_linkedin_ads__creative_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "last_modified_time": {"type": "timestamp without time zone", "index": 2, "name": "last_modified_time", "comment": null}, "created_time": {"type": "timestamp without time zone", "index": 3, "name": "created_time", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "version_tag": {"type": "integer", "index": 6, "name": "version_tag", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}, "click_uri": {"type": "character varying", "index": 8, "name": "click_uri", "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.linkedin_source.stg_linkedin_ads__creative_history_tmp"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 70942ae..2885dae 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-12-20T02:42:44.984814Z", "invocation_id": "c6defb77-4ceb-4ee2-acc8-e4157c757363", "env": {}, "project_id": "f1bddc747961ccc49643c2a9639b67aa", "user_id": "8929baf0-9bc1-477e-9a57-eb8b0db4da62", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.linkedin_integration_tests.linkedin_campaign_group_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": {"created_time": "timestamp", "last_modified_time": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_campaign_group_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_group_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_campaign_group_history_data.csv", "original_file_path": "seeds/linkedin_campaign_group_history_data.csv", "name": "linkedin_campaign_group_history_data", "alias": "linkedin_campaign_group_history_data", "checksum": {"name": "sha256", "checksum": "a3e2f426d56d779f1bcb3013b2d4862e7a8203c0372c4892e598165fedab1744"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp"}}, "created_at": 1671504154.4842298, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_group_history_data\""}, "seed.linkedin_integration_tests.linkedin_account_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": {"created_time": "timestamp", "last_modified_time": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_account_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_account_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_account_history_data.csv", "original_file_path": "seeds/linkedin_account_history_data.csv", "name": "linkedin_account_history_data", "alias": "linkedin_account_history_data", "checksum": {"name": "sha256", "checksum": "e00ceef7b82a006c9fb463fe928e58f1d0bdaeddb0541508934c62d0142084fb"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp"}}, "created_at": 1671504154.490227, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_account_history_data\""}, "seed.linkedin_integration_tests.linkedin_campaign_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": {"created_time": "timestamp", "last_modified_time": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_campaign_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_campaign_history_data.csv", "original_file_path": "seeds/linkedin_campaign_history_data.csv", "name": "linkedin_campaign_history_data", "alias": "linkedin_campaign_history_data", "checksum": {"name": "sha256", "checksum": "90cdf3c013456ff4a40f502e0d55fa10be2dfdb269b5b79b41671ab4558ae879"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp"}}, "created_at": 1671504154.4914718, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_history_data\""}, "seed.linkedin_integration_tests.linkedin_creative_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": {"created_time": "timestamp", "last_modified_time": "timestamp", "click_uri": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_creative_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_creative_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_creative_history_data.csv", "original_file_path": "seeds/linkedin_creative_history_data.csv", "name": "linkedin_creative_history_data", "alias": "linkedin_creative_history_data", "checksum": {"name": "sha256", "checksum": "60d568d212f155df35c86f9d39572cf55a733c53598016adb0aa9b4df79ce2e8"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp", "click_uri": "{{ 'string' if target.type in ('bigquery','spark','databricks') else 'varchar' }}"}}, "created_at": 1671504154.492787, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_creative_history_data\""}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_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": {"day": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_ad_analytics_by_creative_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_ad_analytics_by_creative_data.csv", "original_file_path": "seeds/linkedin_ad_analytics_by_creative_data.csv", "name": "linkedin_ad_analytics_by_creative_data", "alias": "linkedin_ad_analytics_by_creative_data", "checksum": {"name": "sha256", "checksum": "90a1a324923b47307989ab10594f537f8c45262ffcdfd8ffbe09bae7f05760f7"}, "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": {"column_types": {"day": "timestamp"}}, "created_at": 1671504154.493977, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_creative_data\""}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_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": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_ad_analytics_by_campaign_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_ad_analytics_by_campaign_data.csv", "original_file_path": "seeds/linkedin_ad_analytics_by_campaign_data.csv", "name": "linkedin_ad_analytics_by_campaign_data", "alias": "linkedin_ad_analytics_by_campaign_data", "checksum": {"name": "sha256", "checksum": "a6b72fcf11043561ec04bae0035659363e992cd11f8ed5376f056b7f4e5b5b32"}, "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": {}, "created_at": 1671504154.495357, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_campaign_data\""}, "model.linkedin_source.stg_linkedin_ads__creative_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_creative_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.dbt_utils.get_url_parameter"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history_tmp", "model.linkedin_source.stg_linkedin_ads__creative_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__creative_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__creative_history_tmp') }}\n\n), macro as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__creative_history_tmp')),\n staging_columns=get_creative_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select\n id as creative_id,\n campaign_id,\n type,\n cast(version_tag as numeric) as version_tag,\n status,\n click_uri,\n call_to_action_label_type,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n), url_fields as (\n\n select \n *,\n {{ dbt.split_part('click_uri', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('click_uri') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('click_uri') }} as url_path,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_source') }} as utm_source,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_medium') }} as utm_medium,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_campaign') }} as utm_campaign,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_content') }} as utm_content,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_term') }} as utm_term\n \n from fields\n)\n\nselect *\nfrom url_fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__creative_history.sql", "original_file_path": "models/stg_linkedin_ads__creative_history.sql", "name": "stg_linkedin_ads__creative_history", "alias": "stg_linkedin_ads__creative_history", "checksum": {"name": "sha256", "checksum": "d00cfaa4090be843e4157a73bf2e05ae970fe6fa654b234cd2d05b304c0c36e0"}, "tags": [], "refs": [["stg_linkedin_ads__creative_history_tmp"], ["stg_linkedin_ads__creative_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of a creative.", "columns": {"creative_id": {"name": "creative_id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the creative was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign the creative belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text with Sponsored Link to landing page on your site.\nSPONSORED_STATUS_UPDATE - Sponsored status update from a profile page.\nSPONSORED_INMAILS - Single message ad delivered to the member's inbox\nSPONSORED_MESSAGE - Conversation ad containing a tree of pre-determined messages delivered to the member's inbox\nSPONSORED_VIDEO - Sponsored videos.\nSPONSORED_UPDATE_CAROUSEL - Sponsored Carousels\nFOLLOW_COMPANY_V2 - Dynamic Follow Ad\nSPOTLIGHT_V2 - Dynamic Spotlight Ad\nJOBS_V2 - Dynamic Job Ad\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Creative creation is complete and creative is available for review and serve.\nPAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation.\nDRAFT - Creative creation is incomplete and may still be edited.\nARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI.\nCANCELED - Creative is permanently canceled.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "call_to_action_label_type": {"name": "call_to_action_label_type", "description": "The labeled call-to-action on this ad.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the cretive.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__creative_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.727792, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history_tmp\"\n\n), macro as (\n\n select \n \n cast(null as TEXT) as \n \n call_to_action_label_type\n \n , \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n click_uri\n \n as \n \n click_uri\n \n, \n \n \n created_time\n \n as \n \n created_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n version_tag\n \n as \n \n version_tag\n \n\n\n\n from base\n\n), fields as (\n\n select\n id as creative_id,\n campaign_id,\n type,\n cast(version_tag as numeric) as version_tag,\n status,\n click_uri,\n call_to_action_label_type,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n), url_fields as (\n\n select \n *,\n \n\n \n \n\n split_part(\n click_uri,\n '?',\n 1\n )\n\n\n \n\n as base_url,\n \n \n cast(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n \n\n replace(\n \n\n replace(\n \n\n replace(\n click_uri,\n 'android-app://',\n ''\n )\n\n\n,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n,\n '/',\n 1\n )\n\n\n \n\n,\n '?',\n 1\n )\n\n\n \n\n as TEXT)\n as url_host,\n '/' || \n \n cast(\n\n \n \n\n split_part(\n \n\n right(\n \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n,\n \n\n length(\n \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n\n )-coalesce(\n nullif(\n\n position(\n '/' in \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n\n ), 0),\n \n\n position(\n '?' in \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n\n ) - 1\n )\n ),\n '?',\n 1\n )\n\n\n \n\n as TEXT)\n as url_path,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_source=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_source,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_medium=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_medium,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_campaign=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_campaign,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_content=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_content,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_term=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_term\n \n from fields\n)\n\nselect *\nfrom url_fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\""}, "model.linkedin_source.stg_linkedin_ads__campaign_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__campaign_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__campaign_history_tmp') }}\n\n), macro as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select \n id as campaign_id,\n name as campaign_name,\n cast(version_tag as numeric) as version_tag,\n campaign_group_id,\n account_id,\n status,\n type,\n cost_type,\n creative_selection,\n daily_budget_amount,\n daily_budget_currency_code,\n unit_cost_amount,\n unit_cost_currency_code,\n format,\n locale_country,\n locale_language,\n objective_type,\n optimization_target_type,\n audience_expansion_enabled as is_audience_expansion_enabled,\n offsite_delivery_enabled as is_offsite_delivery_enabled,\n cast(run_schedule_start as {{ dbt.type_timestamp() }}) as run_schedule_start_at,\n cast(run_schedule_end as {{ dbt.type_timestamp() }}) as run_schedule_end_at,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__campaign_history.sql", "original_file_path": "models/stg_linkedin_ads__campaign_history.sql", "name": "stg_linkedin_ads__campaign_history", "alias": "stg_linkedin_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "12f98866db796269913da635f3597191300af87f91d3e018768b16c927e8f77f"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history_tmp"], ["stg_linkedin_ads__campaign_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of a campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "The ID of the campaign group the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_audience_expansion_enabled": {"name": "is_audience_expansion_enabled", "description": "Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_type": {"name": "cost_type", "description": "CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000.\nCPC- Cost per individual click on the associated link.\nCPV- Cost per view for video ads.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_selection": {"name": "creative_selection", "description": "ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible.\nOPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_amount": {"name": "daily_budget_amount", "description": "Maximum amount to spend per day UTC. The amount of money as a real number string.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_currency_code": {"name": "daily_budget_currency_code", "description": "ISO currency code. The currency must match that of the parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "format": {"name": "format", "description": "The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_country": {"name": "locale_country", "description": "Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_language": {"name": "locale_language", "description": "Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_offsite_delivery_enabled": {"name": "is_offsite_delivery_enabled", "description": "Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites.\t(default will be \"True\" from June 30, 2022)\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "optimization_target_type": {"name": "optimization_target_type", "description": "Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn.\nSPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed.\nSPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox.\nDYNAMIC - Ads that are dynamically personalized.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_amount": {"name": "unit_cost_amount", "description": "This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_currency_code": {"name": "unit_cost_currency_code", "description": "Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__campaign_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.7322, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history_tmp\"\n\n), macro as (\n\n select \n \n \n \n account_id\n \n as \n \n account_id\n \n, \n cast(null as boolean) as \n \n audience_expansion_enabled\n \n , \n \n \n campaign_group_id\n \n as \n \n campaign_group_id\n \n, \n cast(null as TEXT) as \n \n cost_type\n \n , \n \n \n created_time\n \n as \n \n created_time\n \n, \n cast(null as TEXT) as \n \n creative_selection\n \n , \n cast(null as FLOAT) as \n \n daily_budget_amount\n \n , \n cast(null as TEXT) as \n \n daily_budget_currency_code\n \n , \n cast(null as TEXT) as \n \n format\n \n , \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n cast(null as TEXT) as \n \n locale_country\n \n , \n cast(null as TEXT) as \n \n locale_language\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as TEXT) as \n \n objective_type\n \n , \n cast(null as boolean) as \n \n offsite_delivery_enabled\n \n , \n cast(null as TEXT) as \n \n optimization_target_type\n \n , \n cast(null as TIMESTAMP) as \n \n run_schedule_end\n \n , \n cast(null as TIMESTAMP) as \n \n run_schedule_start\n \n , \n cast(null as TEXT) as \n \n status\n \n , \n cast(null as TEXT) as \n \n type\n \n , \n cast(null as FLOAT) as \n \n unit_cost_amount\n \n , \n cast(null as TEXT) as \n \n unit_cost_currency_code\n \n , \n \n \n version_tag\n \n as \n \n version_tag\n \n\n\n\n from base\n\n), fields as (\n\n select \n id as campaign_id,\n name as campaign_name,\n cast(version_tag as numeric) as version_tag,\n campaign_group_id,\n account_id,\n status,\n type,\n cost_type,\n creative_selection,\n daily_budget_amount,\n daily_budget_currency_code,\n unit_cost_amount,\n unit_cost_currency_code,\n format,\n locale_country,\n locale_language,\n objective_type,\n optimization_target_type,\n audience_expansion_enabled as is_audience_expansion_enabled,\n offsite_delivery_enabled as is_offsite_delivery_enabled,\n cast(run_schedule_start as TIMESTAMP) as run_schedule_start_at,\n cast(run_schedule_end as TIMESTAMP) as run_schedule_end_at,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_ad_analytics_by_campaign_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.date_trunc", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__ad_analytics_by_campaign"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_linkedin_ads__ad_analytics_by_campaign_tmp') }}\n),\n\nmacro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__ad_analytics_by_campaign_tmp')),\n staging_columns=get_ad_analytics_by_campaign_columns()\n )\n }}\n from base\n),\n\nfields as (\n \n select \n {{ dbt.date_trunc('day', 'day') }} as date_day,\n campaign_id,\n clicks,\n impressions,\n {% if var('linkedin_ads__use_local_currency', false) %}\n cost_in_local_currency as cost\n {% else %}\n cost_in_usd as cost\n {% endif %}\n\n {{ fivetran_utils.fill_pass_through_columns('linkedin_ads__campaign_passthrough_metrics') }}\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__ad_analytics_by_campaign.sql", "original_file_path": "models/stg_linkedin_ads__ad_analytics_by_campaign.sql", "name": "stg_linkedin_ads__ad_analytics_by_campaign", "alias": "stg_linkedin_ads__ad_analytics_by_campaign", "checksum": {"name": "sha256", "checksum": "b0bf02e1776326897d77e8060a8f30689fa628b67e826fa86198aef533c31569"}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign_tmp"], ["stg_linkedin_ads__ad_analytics_by_campaign_tmp"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the campaign level.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the related creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__ad_analytics_by_campaign.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.724225, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign_tmp\"\n),\n\nmacro as (\n\n select\n \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n clicks\n \n as \n \n clicks\n \n, \n \n \n cost_in_local_currency\n \n as \n \n cost_in_local_currency\n \n, \n \n \n cost_in_usd\n \n as \n \n cost_in_usd\n \n, \n \n \n day\n \n as \n \n day\n \n, \n \n \n impressions\n \n as \n \n impressions\n \n\n\n\n from base\n),\n\nfields as (\n \n select \n date_trunc('day', day) as date_day,\n campaign_id,\n clicks,\n impressions,\n \n cost_in_usd as cost\n \n\n \n\n\n\n\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\""}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_campaign_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__campaign_group_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__campaign_group_history_tmp') }}\n\n), macro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__campaign_group_history_tmp')),\n staging_columns=get_campaign_group_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select \n id as campaign_group_id,\n name as campaign_group_name,\n account_id,\n status,\n backfilled as is_backfilled,\n cast(run_schedule_start as {{ dbt.type_timestamp() }}) as run_schedule_start_at,\n cast(run_schedule_end as {{ dbt.type_timestamp() }}) as run_schedule_end_at,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__campaign_group_history.sql", "original_file_path": "models/stg_linkedin_ads__campaign_group_history.sql", "name": "stg_linkedin_ads__campaign_group_history", "alias": "stg_linkedin_ads__campaign_group_history", "checksum": {"name": "sha256", "checksum": "9e4b57accd4f0a428f53d1b953c3c9dc25d6b5fbf4255f3a224f071f35474b66"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history_tmp"], ["stg_linkedin_ads__campaign_group_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of a campaign group.", "columns": {"campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign group belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign group was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_backfilled": {"name": "is_backfilled", "description": "Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__campaign_group_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.734785, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history_tmp\"\n\n), macro as (\n\n select\n \n \n \n account_id\n \n as \n \n account_id\n \n, \n cast(null as boolean) as \n \n backfilled\n \n , \n \n \n created_time\n \n as \n \n created_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n \n \n name\n \n as \n \n name\n \n, \n cast(null as TIMESTAMP) as \n \n run_schedule_end\n \n , \n cast(null as TIMESTAMP) as \n \n run_schedule_start\n \n , \n cast(null as TEXT) as \n \n status\n \n \n\n\n from base\n\n), fields as (\n\n select \n id as campaign_group_id,\n name as campaign_group_name,\n account_id,\n status,\n backfilled as is_backfilled,\n cast(run_schedule_start as TIMESTAMP) as run_schedule_start_at,\n cast(run_schedule_end as TIMESTAMP) as run_schedule_end_at,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\""}, "model.linkedin_source.stg_linkedin_ads__account_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_account_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history_tmp", "model.linkedin_source.stg_linkedin_ads__account_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__account_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__account_history_tmp') }}\n\n), macro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__account_history_tmp')),\n staging_columns=get_account_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select \n id as account_id,\n name as account_name,\n currency,\n cast(version_tag as numeric) as version_tag,\n status,\n type,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__account_history.sql", "original_file_path": "models/stg_linkedin_ads__account_history.sql", "name": "stg_linkedin_ads__account_history", "alias": "stg_linkedin_ads__account_history", "checksum": {"name": "sha256", "checksum": "60047b6cc68c2bee2b8c25f07872167514305c30028cb0a589f55d82721f8593"}, "tags": [], "refs": [["stg_linkedin_ads__account_history_tmp"], ["stg_linkedin_ads__account_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of an account.", "columns": {"account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the account was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Account is active; this is the default state\nCANCELLED - Account has been permanently cancelled\nDRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving\nPENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending\nREMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "BUSINESS - This is the only value allowed when creating accounts through the API.\nENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__account_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.736545, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history_tmp\"\n\n), macro as (\n\n select\n \n \n \n created_time\n \n as \n \n created_time\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n \n \n name\n \n as \n \n name\n \n, \n cast(null as TEXT) as \n \n status\n \n , \n cast(null as TEXT) as \n \n type\n \n , \n \n \n version_tag\n \n as \n \n version_tag\n \n\n\n\n from base\n\n), fields as (\n\n select \n id as account_id,\n name as account_name,\n currency,\n cast(version_tag as numeric) as version_tag,\n status,\n type,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_ad_analytics_by_creative_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.date_trunc", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__ad_analytics_by_creative"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__ad_analytics_by_creative_tmp') }}\n\n), macro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__ad_analytics_by_creative_tmp')),\n staging_columns=get_ad_analytics_by_creative_columns()\n )\n }}\n from base\n\n), fields as (\n\n select\n {{ dbt.date_trunc('day', 'day') }} as date_day,\n creative_id,\n clicks, \n impressions,\n {% if var('linkedin_ads__use_local_currency', false) %}\n cost_in_local_currency as cost\n {% else %}\n cost_in_usd as cost\n {% endif %}\n\n {{ fivetran_utils.fill_pass_through_columns('linkedin_ads__creative_passthrough_metrics') }}\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__ad_analytics_by_creative.sql", "original_file_path": "models/stg_linkedin_ads__ad_analytics_by_creative.sql", "name": "stg_linkedin_ads__ad_analytics_by_creative", "alias": "stg_linkedin_ads__ad_analytics_by_creative", "checksum": {"name": "sha256", "checksum": "b5f5b1df9cc38a98aa8438602b219af4468b1493711e5b3ee01fb8836c61d2de"}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative_tmp"], ["stg_linkedin_ads__ad_analytics_by_creative_tmp"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the creative level.", "columns": {"creative_id": {"name": "creative_id", "description": "The ID of the related creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__ad_analytics_by_creative.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.7228, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative_tmp\"\n\n), macro as (\n\n select\n \n \n \n clicks\n \n as \n \n clicks\n \n, \n \n \n cost_in_local_currency\n \n as \n \n cost_in_local_currency\n \n, \n \n \n cost_in_usd\n \n as \n \n cost_in_usd\n \n, \n \n \n creative_id\n \n as \n \n creative_id\n \n, \n \n \n day\n \n as \n \n day\n \n, \n \n \n impressions\n \n as \n \n impressions\n \n\n\n\n from base\n\n), fields as (\n\n select\n date_trunc('day', day) as date_day,\n creative_id,\n clicks, \n impressions,\n \n cost_in_usd as cost\n \n\n \n\n\n\n\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__ad_analytics_by_creative_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('ad_analytics_by_creative') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__ad_analytics_by_creative_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__ad_analytics_by_creative_tmp.sql", "name": "stg_linkedin_ads__ad_analytics_by_creative_tmp", "alias": "stg_linkedin_ads__ad_analytics_by_creative_tmp", "checksum": {"name": "sha256", "checksum": "b1140ca3ef37dcf51382d1d423a866f8e99ab568e995419aaa0d6cc46ba9e2c2"}, "tags": [], "refs": [["linkedin_ad_analytics_by_creative_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__ad_analytics_by_creative_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.612212, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_creative_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative_tmp\""}, "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_campaign_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__campaign_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('campaign_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__campaign_history_tmp.sql", "name": "stg_linkedin_ads__campaign_history_tmp", "alias": "stg_linkedin_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "cebe89ef38c2b2a3e4c78f3a30350598b00910af0597c348f07c9e2d29591441"}, "tags": [], "refs": [["linkedin_campaign_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__campaign_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.625001, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__account_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_account_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__account_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('account_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__account_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__account_history_tmp.sql", "name": "stg_linkedin_ads__account_history_tmp", "alias": "stg_linkedin_ads__account_history_tmp", "checksum": {"name": "sha256", "checksum": "d7ffa4b7ad250c8643b99abf7d1ee1099a1b01e847424247f469fb8b49bac5b9"}, "tags": [], "refs": [["linkedin_account_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__account_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.629087, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_account_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_campaign_group_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__campaign_group_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('campaign_group_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__campaign_group_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__campaign_group_history_tmp.sql", "name": "stg_linkedin_ads__campaign_group_history_tmp", "alias": "stg_linkedin_ads__campaign_group_history_tmp", "checksum": {"name": "sha256", "checksum": "704cfe15aec2c0f1de75b8c78a082b45ae6fa6a03198dc210d8eeacb8bd643b8"}, "tags": [], "refs": [["linkedin_campaign_group_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__campaign_group_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.6326761, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_group_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_creative_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__creative_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('creative_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__creative_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__creative_history_tmp.sql", "name": "stg_linkedin_ads__creative_history_tmp", "alias": "stg_linkedin_ads__creative_history_tmp", "checksum": {"name": "sha256", "checksum": "0b886b1ffe53a073e6123a79cc2dd4b0576178d82e38be84fddc1f70e8b3d0fc"}, "tags": [], "refs": [["linkedin_creative_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__creative_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.636134, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_creative_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__ad_analytics_by_campaign_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect * \nfrom {{ var('ad_analytics_by_campaign') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__ad_analytics_by_campaign_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__ad_analytics_by_campaign_tmp.sql", "name": "stg_linkedin_ads__ad_analytics_by_campaign_tmp", "alias": "stg_linkedin_ads__ad_analytics_by_campaign_tmp", "checksum": {"name": "sha256", "checksum": "03a126189ee0a2fe1d514ff02883403a1c9e8d8f9fe928262c338b61246cd7ef"}, "tags": [], "refs": [["linkedin_ad_analytics_by_campaign_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__ad_analytics_by_campaign_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1671504154.6405602, "compiled_code": "\n\nselect * \nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_campaign_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign_tmp\""}, "model.linkedin.linkedin_ads__campaign_group_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__campaign_group_report"], "unique_id": "model.linkedin.linkedin_ads__campaign_group_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith campaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_campaign') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign_group.status,\n account.currency,\n campaign_group.is_backfilled,\n campaign_group.run_schedule_start_at,\n campaign_group.run_schedule_end_at,\n campaign_group.last_modified_at,\n campaign_group.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__campaign_passthrough_metrics', transform='sum') }}\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=12) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__campaign_group_report.sql", "original_file_path": "models/linkedin_ads__campaign_group_report.sql", "name": "linkedin_ads__campaign_group_report", "alias": "linkedin_ads__campaign_group_report", "checksum": {"name": "sha256", "checksum": "bc4b9b9b612d1fbbecffc8059005e832e333df998e1b9aad50a3a2dc71125885"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the campaign group level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign group was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_backfilled": {"name": "is_backfilled", "description": "Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__campaign_group_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1671504154.8098729, "compiled_code": "\n\nwith campaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign_group.status,\n account.currency,\n campaign_group.is_backfilled,\n campaign_group.run_schedule_start_at,\n campaign_group.run_schedule_end_at,\n campaign_group.last_modified_at,\n campaign_group.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\""}, "model.linkedin.linkedin_ads__creative_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__creative_report"], "unique_id": "model.linkedin.linkedin_ads__creative_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith creative as (\n\n select *\n from {{ var('creative_history') }}\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_creative') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n creative.type,\n creative.click_uri,\n creative.status as creative_status,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n creative.call_to_action_label_type,\n account.currency,\n creative.last_modified_at,\n creative.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__creative_passthrough_metrics', transform='sum') }}\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=18) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__creative_report.sql", "original_file_path": "models/linkedin_ads__creative_report.sql", "name": "linkedin_ads__creative_report", "alias": "linkedin_ads__creative_report", "checksum": {"name": "sha256", "checksum": "ad0eb0c1b25863f9e362dc4aa0d568a06f4a12bed2bd47cfb6bb4cb51ac658d3"}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the creative level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_id": {"name": "creative_id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the creative was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text with Sponsored Link to landing page on your site.\nSPONSORED_STATUS_UPDATE - Sponsored status update from a profile page.\nSPONSORED_INMAILS - Single message ad delivered to the member's inbox\nSPONSORED_MESSAGE - Conversation ad containing a tree of pre-determined messages delivered to the member's inbox\nSPONSORED_VIDEO - Sponsored videos.\nSPONSORED_UPDATE_CAROUSEL - Sponsored Carousels\nFOLLOW_COMPANY_V2 - Dynamic Follow Ad\nSPOTLIGHT_V2 - Dynamic Spotlight Ad\nJOBS_V2 - Dynamic Job Ad\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_status": {"name": "creative_status", "description": "ACTIVE - Creative creation is complete and creative is available for review and serve.\nPAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation.\nDRAFT - Creative creation is incomplete and may still be edited.\nARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI.\nCANCELED - Creative is permanently canceled.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "call_to_action_label_type": {"name": "call_to_action_label_type", "description": "The labeled call-to-action on this ad.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_status": {"name": "campaign_group_status", "description": "Status of campaign's campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_status": {"name": "campaign_status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__creative_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1671504154.813726, "compiled_code": "\n\nwith creative as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n creative.type,\n creative.click_uri,\n creative.status as creative_status,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n creative.call_to_action_label_type,\n account.currency,\n creative.last_modified_at,\n creative.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\""}, "model.linkedin.linkedin_ads__campaign_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__campaign_report"], "unique_id": "model.linkedin.linkedin_ads__campaign_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith campaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_campaign') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign.version_tag,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n campaign.type,\n campaign.cost_type,\n campaign.creative_selection,\n campaign.daily_budget_amount,\n campaign.daily_budget_currency_code,\n campaign.unit_cost_amount,\n campaign.unit_cost_currency_code,\n account.currency,\n campaign.format,\n campaign.locale_country,\n campaign.locale_language,\n campaign.objective_type,\n campaign.optimization_target_type,\n campaign.is_audience_expansion_enabled,\n campaign.is_offsite_delivery_enabled,\n campaign.run_schedule_start_at,\n campaign.run_schedule_end_at,\n campaign.last_modified_at,\n campaign.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__campaign_passthrough_metrics', transform='sum') }}\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=29) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__campaign_report.sql", "original_file_path": "models/linkedin_ads__campaign_report.sql", "name": "linkedin_ads__campaign_report", "alias": "linkedin_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "1c31aeced5e5a136b419b285d15509067f2556a279da032a1002b4a3fa18879c"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the campaign level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_status": {"name": "campaign_group_status", "description": "Status of campaign's campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_audience_expansion_enabled": {"name": "is_audience_expansion_enabled", "description": "Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_type": {"name": "cost_type", "description": "CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000.\nCPC- Cost per individual click on the associated link.\nCPV- Cost per view for video ads.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_selection": {"name": "creative_selection", "description": "ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible.\nOPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_amount": {"name": "daily_budget_amount", "description": "Maximum amount to spend per day UTC. The amount of money as a real number string.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_currency_code": {"name": "daily_budget_currency_code", "description": "ISO currency code. The currency must match that of the parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "format": {"name": "format", "description": "The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_country": {"name": "locale_country", "description": "Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_language": {"name": "locale_language", "description": "Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_offsite_delivery_enabled": {"name": "is_offsite_delivery_enabled", "description": "Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites.\t(default will be \"True\" from June 30, 2022)\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "optimization_target_type": {"name": "optimization_target_type", "description": "Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_status": {"name": "campaign_status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn.\nSPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed.\nSPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox.\nDYNAMIC - Ads that are dynamically personalized.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_amount": {"name": "unit_cost_amount", "description": "This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_currency_code": {"name": "unit_cost_currency_code", "description": "Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__campaign_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1671504154.80662, "compiled_code": "\n\nwith campaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign.version_tag,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n campaign.type,\n campaign.cost_type,\n campaign.creative_selection,\n campaign.daily_budget_amount,\n campaign.daily_budget_currency_code,\n campaign.unit_cost_amount,\n campaign.unit_cost_currency_code,\n account.currency,\n campaign.format,\n campaign.locale_country,\n campaign.locale_language,\n campaign.objective_type,\n campaign.optimization_target_type,\n campaign.is_audience_expansion_enabled,\n campaign.is_offsite_delivery_enabled,\n campaign.run_schedule_start_at,\n campaign.run_schedule_end_at,\n campaign.last_modified_at,\n campaign.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\""}, "model.linkedin.linkedin_ads__account_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__account_report"], "unique_id": "model.linkedin.linkedin_ads__account_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith account as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_campaign') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n account.account_id,\n account.account_name,\n account.version_tag,\n account.currency,\n account.status,\n account.type,\n account.last_modified_at,\n account.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__campaign_passthrough_metrics', transform='sum') }}\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=9) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__account_report.sql", "original_file_path": "models/linkedin_ads__account_report.sql", "name": "linkedin_ads__account_report", "alias": "linkedin_ads__account_report", "checksum": {"name": "sha256", "checksum": "081d8687fbed2359f5893891308f9b3a0f25a7982a8b206f416f1a60d5c1aa6f"}, "tags": [], "refs": [["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the account was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Account is active; this is the default state\nCANCELLED - Account has been permanently cancelled\nDRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving\nPENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending\nREMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "BUSINESS - This is the only value allowed when creating accounts through the API.\nENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__account_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1671504154.801428, "compiled_code": "\n\nwith account as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n),\n\nfinal as (\n\n select \n report.date_day,\n account.account_id,\n account.account_name,\n account.version_tag,\n account.currency,\n account.status,\n account.type,\n account.last_modified_at,\n account.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\""}, "model.linkedin.linkedin_ads__url_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__url_report"], "unique_id": "model.linkedin.linkedin_ads__url_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith creative as (\n\n select *\n from {{ var('creative_history') }}\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_creative') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.click_uri,\n creative.base_url,\n creative.url_host,\n creative.url_path,\n creative.utm_source,\n creative.utm_medium,\n creative.utm_campaign,\n creative.utm_content,\n creative.utm_term,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n account.currency,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__creative_passthrough_metrics', transform='sum') }}\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n where creative.click_uri is not null\n {% endif %}\n\n {{ dbt_utils.group_by(n=19) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__url_report.sql", "original_file_path": "models/linkedin_ads__url_report.sql", "name": "linkedin_ads__url_report", "alias": "linkedin_ads__url_report", "checksum": {"name": "sha256", "checksum": "a6fc831c81a332b65e5a3339f027025fa506058f913433fcbbe639ee93653972"}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the url level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_id": {"name": "creative_id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__url_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1671504154.8180969, "compiled_code": "\n\nwith creative as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.click_uri,\n creative.base_url,\n creative.url_host,\n creative.url_path,\n creative.utm_source,\n creative.utm_medium,\n creative.utm_campaign,\n creative.utm_content,\n creative.utm_term,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n account.currency,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n \n where creative.click_uri is not null\n \n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\""}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_creative')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.741409, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_creative"}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_creative')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.7426891, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_creative"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "creative_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_creative')) }}"}, "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id", "alias": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9"}, "created_at": 1671504154.743863, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, creative_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\n group by date_day, creative_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_linkedin_ads__ad_analytics_by_creative"}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_campaign')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.751221, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_campaign"}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_campaign')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.752256, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_campaign"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "campaign_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_campaign')) }}"}, "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id", "alias": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c"}, "created_at": 1671504154.753401, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, campaign_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n group by date_day, campaign_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_linkedin_ads__ad_analytics_by_campaign"}, "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__creative_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__creative_history_creative_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__creative_history_creative_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__creative_history_creative_id", "alias": "not_null_stg_linkedin_ads__creative_history_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__creative_history_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.756125, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.stg_linkedin_ads__creative_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_tag", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__creative_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__creative_history_version_tag"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__creative_history_version_tag.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__creative_history_version_tag", "alias": "not_null_stg_linkedin_ads__creative_history_version_tag", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__creative_history_version_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.757237, "compiled_code": "\n \n \n\n\n\nselect version_tag\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\nwhere version_tag is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "version_tag", "file_key_name": "models.stg_linkedin_ads__creative_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["version_tag", "creative_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__creative_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.linkedin_source.stg_linkedin_ads__creative_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id", "alias": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc"}, "created_at": 1671504154.758226, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n version_tag, creative_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\n group by version_tag, creative_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_linkedin_ads__creative_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_history_campaign_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_history_campaign_id", "alias": "not_null_stg_linkedin_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__campaign_history_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.7609558, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.stg_linkedin_ads__campaign_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_tag", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_history_version_tag"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__campaign_history_version_tag.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_history_version_tag", "alias": "not_null_stg_linkedin_ads__campaign_history_version_tag", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__campaign_history_version_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.7619462, "compiled_code": "\n \n \n\n\n\nselect version_tag\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\nwhere version_tag is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "version_tag", "file_key_name": "models.stg_linkedin_ads__campaign_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["version_tag", "campaign_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_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.linkedin_source.stg_linkedin_ads__campaign_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id", "alias": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361"}, "created_at": 1671504154.7629418, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n version_tag, campaign_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n group by version_tag, campaign_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_linkedin_ads__campaign_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_group_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_group_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"]}, "config": {"enabled": true, "alias": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id", "alias": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a"}, "created_at": 1671504154.765682, "compiled_code": "\n \n \n\n\n\nselect campaign_group_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\nwhere campaign_group_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_group_id", "file_key_name": "models.stg_linkedin_ads__campaign_group_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_modified_at", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_group_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"]}, "config": {"enabled": true, "alias": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_group_history_last_modified_at"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_group_history_last_modified_at", "alias": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd"}, "created_at": 1671504154.7667022, "compiled_code": "\n \n \n\n\n\nselect last_modified_at\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\nwhere last_modified_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "last_modified_at", "file_key_name": "models.stg_linkedin_ads__campaign_group_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["last_modified_at", "campaign_group_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_group_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.linkedin_source.stg_linkedin_ads__campaign_group_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id", "alias": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14"}, "created_at": 1671504154.767849, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n last_modified_at, campaign_group_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n group by last_modified_at, campaign_group_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_linkedin_ads__campaign_group_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__account_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__account_history_account_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__account_history_account_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__account_history_account_id", "alias": "not_null_stg_linkedin_ads__account_history_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__account_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__account_history_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.770726, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id", "file_key_name": "models.stg_linkedin_ads__account_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_tag", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__account_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__account_history_version_tag"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__account_history_version_tag.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__account_history_version_tag", "alias": "not_null_stg_linkedin_ads__account_history_version_tag", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__account_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__account_history_version_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.771808, "compiled_code": "\n \n \n\n\n\nselect version_tag\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\nwhere version_tag is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "version_tag", "file_key_name": "models.stg_linkedin_ads__account_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["account_id", "version_tag"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__account_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.linkedin_source.stg_linkedin_ads__account_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag", "alias": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__account_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55"}, "created_at": 1671504154.772864, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n account_id, version_tag\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n group by account_id, version_tag\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_linkedin_ads__account_history"}, "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('linkedin_ads__account_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__account_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__account_report_account_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__account_report_account_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__account_report_account_id", "alias": "not_null_linkedin_ads__account_report_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__account_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__account_report_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.8187, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\"\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id", "file_key_name": "models.linkedin_ads__account_report"}, "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__account_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__account_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__account_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__account_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__account_report_date_day", "alias": "not_null_linkedin_ads__account_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__account_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__account_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.8199701, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__account_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__account_report')) }}"}, "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.linkedin.linkedin_ads__account_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id", "alias": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__account_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231"}, "created_at": 1671504154.8212779, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\"\n group by date_day, account_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.linkedin_ads__account_report"}, "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_report_date_day", "alias": "not_null_linkedin_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.824461, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__campaign_report"}, "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_report_campaign_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_report_campaign_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_report_campaign_id", "alias": "not_null_linkedin_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_report_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.825786, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.linkedin_ads__campaign_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "campaign_id", "account_id", "campaign_group_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_report')) }}"}, "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.linkedin.linkedin_ads__campaign_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id", "alias": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873"}, "created_at": 1671504154.826911, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, campaign_id, account_id, campaign_group_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\"\n group by date_day, campaign_id, account_id, campaign_group_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.linkedin_ads__campaign_report"}, "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_group_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_group_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_group_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_group_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_group_report_date_day", "alias": "not_null_linkedin_ads__campaign_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_group_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_group_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.8304489, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__campaign_group_report"}, "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_group_id", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_group_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_group_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_group_report_campaign_group_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_group_report_campaign_group_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_group_report_campaign_group_id", "alias": "not_null_linkedin_ads__campaign_group_report_campaign_group_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_group_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_group_report_campaign_group_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.831599, "compiled_code": "\n \n \n\n\n\nselect campaign_group_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\"\nwhere campaign_group_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_group_id", "file_key_name": "models.linkedin_ads__campaign_group_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "campaign_group_id", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_group_report')) }}"}, "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.linkedin.linkedin_ads__campaign_group_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id", "alias": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_group_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e"}, "created_at": 1671504154.832742, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, campaign_group_id, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\"\n group by date_day, campaign_group_id, account_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.linkedin_ads__campaign_group_report"}, "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__creative_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__creative_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__creative_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__creative_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__creative_report_date_day", "alias": "not_null_linkedin_ads__creative_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__creative_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__creative_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.835992, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__creative_report"}, "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('linkedin_ads__creative_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__creative_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__creative_report_creative_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__creative_report_creative_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__creative_report_creative_id", "alias": "not_null_linkedin_ads__creative_report_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__creative_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__creative_report_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.837323, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.linkedin_ads__creative_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "creative_id", "campaign_id", "campaign_group_id", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__creative_report')) }}"}, "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.linkedin.linkedin_ads__creative_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id", "alias": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__creative_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92"}, "created_at": 1671504154.8383849, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, creative_id, campaign_id, campaign_group_id, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\"\n group by date_day, creative_id, campaign_id, campaign_group_id, account_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.linkedin_ads__creative_report"}, "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__url_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__url_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__url_report_date_day", "alias": "not_null_linkedin_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__url_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.841918, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__url_report"}, "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__url_report_creative_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__url_report_creative_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__url_report_creative_id", "alias": "not_null_linkedin_ads__url_report_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__url_report_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671504154.843081, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.linkedin_ads__url_report"}, "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "click_uri", "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__url_report_click_uri"], "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__url_report_click_uri.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__url_report_click_uri", "alias": "not_null_linkedin_ads__url_report_click_uri", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__url_report_click_uri.sql", "build_path": null, "deferred": false, "unrendered_config": {"enabled": true}, "created_at": 1671504154.844641, "compiled_code": "\n \n \n\n\n\nselect click_uri\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\nwhere click_uri is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "click_uri", "file_key_name": "models.linkedin_ads__url_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "creative_id", "campaign_id", "campaign_group_id", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "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.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id", "alias": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f.sql", "build_path": null, "deferred": false, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f"}, "created_at": 1671504154.84619, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, creative_id, campaign_id, campaign_group_id, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\n group by date_day, creative_id, campaign_id, campaign_group_id, account_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.linkedin_ads__url_report"}}, "sources": {"source.linkedin_source.linkedin.ad_analytics_by_creative": {"fqn": ["linkedin_source", "linkedin", "ad_analytics_by_creative"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.ad_analytics_by_creative", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "ad_analytics_by_creative", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "ad_analytics_by_creative", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record in this table represents the daily performance of ads at the creative level.", "columns": {"creative_id": {"name": "creative_id", "description": "The ID of the related creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "day": {"name": "day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_local_currency": {"name": "cost_in_local_currency", "description": "The cost of the ads in the local currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_usd": {"name": "cost_in_usd", "description": "The cost of the ads in the USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"ad_analytics_by_creative\"", "created_at": 1671504154.8495119}, "source.linkedin_source.linkedin.creative_history": {"fqn": ["linkedin_source", "linkedin", "creative_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.creative_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "creative_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "creative_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of a creative.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the creative was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign the creative belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Creative creation is complete and creative is available for review and serve.\nPAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation.\nDRAFT - Creative creation is incomplete and may still be edited.\nARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI.\nCANCELED - Creative is permanently canceled.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text with Sponsored Link to landing page on your site.\nSPONSORED_STATUS_UPDATE - Sponsored status update from a profile page.\nSPONSORED_INMAILS - Single message ad delivered to the member's inbox\nSPONSORED_MESSAGE - Conversation ad containing a tree of pre-determined messages delivered to the member's inbox\nSPONSORED_VIDEO - Sponsored videos.\nSPONSORED_UPDATE_CAROUSEL - Sponsored Carousels\nFOLLOW_COMPANY_V2 - Dynamic Follow Ad\nSPOTLIGHT_V2 - Dynamic Spotlight Ad\nJOBS_V2 - Dynamic Job Ad\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "call_to_action_label_type": {"name": "call_to_action_label_type", "description": "The labeled call-to-action on this ad.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"creative_history\"", "created_at": 1671504154.849622}, "source.linkedin_source.linkedin.campaign_history": {"fqn": ["linkedin_source", "linkedin", "campaign_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.campaign_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "campaign_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of a campaign.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "The ID of the campaign group the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "A label for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "audience_expansion_enabled": {"name": "audience_expansion_enabled", "description": "Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_type": {"name": "cost_type", "description": "CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000.\nCPC- Cost per individual click on the associated link.\nCPV- Cost per view for video ads.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_selection": {"name": "creative_selection", "description": "ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible.\nOPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_amount": {"name": "daily_budget_amount", "description": "Maximum amount to spend per day UTC. The amount of money as a real number string.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_currency_code": {"name": "daily_budget_currency_code", "description": "ISO currency code. The currency must match that of the parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "format": {"name": "format", "description": "The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_country": {"name": "locale_country", "description": "Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_language": {"name": "locale_language", "description": "Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offsite_delivery_enabled": {"name": "offsite_delivery_enabled", "description": "Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites.\t(default will be \"True\" from June 30, 2022)\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "optimization_target_type": {"name": "optimization_target_type", "description": "Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start": {"name": "run_schedule_start", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end": {"name": "run_schedule_end", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn.\nSPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed.\nSPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox.\nDYNAMIC - Ads that are dynamically personalized.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_amount": {"name": "unit_cost_amount", "description": "This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_currency_code": {"name": "unit_cost_currency_code", "description": "Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"campaign_history\"", "created_at": 1671504154.8497338}, "source.linkedin_source.linkedin.campaign_group_history": {"fqn": ["linkedin_source", "linkedin", "campaign_group_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.campaign_group_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "campaign_group_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "campaign_group_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of a campaign group.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign group belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the campaign group was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "backfilled": {"name": "backfilled", "description": "Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start": {"name": "run_schedule_start", "description": "Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end": {"name": "run_schedule_end", "description": "Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"campaign_group_history\"", "created_at": 1671504154.849816}, "source.linkedin_source.linkedin.account_history": {"fqn": ["linkedin_source", "linkedin", "account_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.account_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "account_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "account_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of an account.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the account was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_campaign_optimization": {"name": "notified_on_campaign_optimization", "description": "Boolean (default=false) indicating if the campaign contact is notified about campaign optimization opportunities", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_creative_approval": {"name": "notified_on_creative_approval", "description": "Boolean (default=false) indicating if the creative contact is notified when a creative has been reviewed and approved", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_creative_rejection": {"name": "notified_on_creative_rejection", "description": "Boolean (default=false) indicating if the creative contact is notified when a creative has been rejected due to content", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_end_of_campaign": {"name": "notified_on_end_of_campaign", "description": "Boolean (default=false) indicating if the campaign contact is notified when an associated campaign has been completed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Account is active; this is the default state\nCANCELLED - Account has been permanently cancelled\nDRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving\nPENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending\nREMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "BUSINESS - This is the only value allowed when creating accounts through the API.\nENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"account_history\"", "created_at": 1671504154.849898}, "source.linkedin_source.linkedin.ad_analytics_by_campaign": {"fqn": ["linkedin_source", "linkedin", "ad_analytics_by_campaign"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.ad_analytics_by_campaign", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "ad_analytics_by_campaign", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "ad_analytics_by_campaign", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record in this table represents the daily performance of ads at the campaign level.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the related campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "day": {"name": "day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_local_currency": {"name": "cost_in_local_currency", "description": "The cost of the ads in the local currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_usd": {"name": "cost_in_usd", "description": "The cost of the ads in the USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"ad_analytics_by_campaign\"", "created_at": 1671504154.8499782}}, "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": 1671504153.905612, "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": 1671504153.905849, "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": 1671504153.905965, "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": 1671504153.906076, "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": 1671504153.9061859, "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": 1671504153.9073868, "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": 1671504153.908094, "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": 1671504153.9135842, "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": 1671504153.914082, "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": 1671504153.914399, "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": 1671504153.914732, "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": 1671504153.915207, "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": 1671504153.915576, "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": 1671504153.915746, "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": 1671504153.91609, "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": 1671504153.9165518, "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": 1671504153.917399, "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": 1671504153.917591, "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": 1671504153.9179, "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": 1671504153.918166, "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": 1671504153.918784, "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": 1671504153.91913, "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": 1671504153.919872, "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": 1671504153.920109, "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": 1671504153.9202402, "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": 1671504153.920901, "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": 1671504153.921887, "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": 1671504153.922268, "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": 1671504153.923022, "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": 1671504153.9265301, "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": 1671504153.926831, "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": 1671504153.927506, "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": 1671504153.928053, "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": 1671504153.929337, "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": 1671504153.9295669, "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": 1671504153.929725, "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": 1671504153.929873, "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": 1671504153.930048, "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": 1671504153.9305332, "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": 1671504153.9308841, "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": 1671504153.931249, "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": 1671504153.93184, "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": 1671504153.932148, "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": 1671504153.935841, "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": 1671504153.93602, "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": 1671504153.936279, "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": 1671504153.9370902, "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": 1671504153.937293, "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": 1671504153.93753, "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": 1671504153.939002, "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": 1671504153.940533, "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": 1671504153.944544, "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": 1671504153.944844, "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": 1671504153.945015, "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": 1671504153.945109, "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": 1671504153.9452538, "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": 1671504153.945371, "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": 1671504153.945578, "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": 1671504153.946471, "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": 1671504153.946671, "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": 1671504153.946927, "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": 1671504153.947367, "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": 1671504153.953282, "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": 1671504153.955424, "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": 1671504153.9559512, "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": 1671504153.9562612, "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": 1671504153.9567099, "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": 1671504153.957098, "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": 1671504153.9587011, "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": 1671504153.959254, "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": 1671504153.959927, "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": 1671504153.960167, "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": 1671504153.960883, "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": 1671504153.96512, "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": 1671504153.966753, "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": 1671504153.967008, "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": 1671504153.967746, "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": 1671504153.968011, "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": 1671504153.9686558, "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": 1671504153.969413, "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": 1671504153.9703739, "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": 1671504153.970665, "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": 1671504153.9708931, "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": 1671504153.971166, "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": 1671504153.971358, "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": 1671504153.971662, "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": 1671504153.9718761, "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": 1671504153.972158, "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": 1671504153.972352, "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": 1671504153.972523, "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": 1671504153.9728289, "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": 1671504153.978291, "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": 1671504153.983967, "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": 1671504153.985256, "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": 1671504153.986563, "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": 1671504153.987503, "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": 1671504153.990319, "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": 1671504153.990979, "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": 1671504153.991198, "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": 1671504153.9916642, "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": 1671504153.992106, "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": 1671504153.9948978, "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": 1671504153.995327, "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": 1671504153.995577, "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": 1671504153.9973109, "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": 1671504153.997801, "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": 1671504153.997998, "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": 1671504153.998198, "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": 1671504153.998472, "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": 1671504154.002113, "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": 1671504154.007117, "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": 1671504154.0081291, "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": 1671504154.008379, "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": 1671504154.008949, "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": 1671504154.009163, "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": 1671504154.0093188, "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": 1671504154.00948, "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": 1671504154.009623, "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": 1671504154.009794, "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": 1671504154.010014, "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": 1671504154.0105448, "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": 1671504154.010731, "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": 1671504154.012332, "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": 1671504154.012888, "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": 1671504154.0131211, "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": 1671504154.013713, "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": 1671504154.013984, "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": 1671504154.014278, "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": 1671504154.014755, "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": 1671504154.015008, "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": 1671504154.015457, "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": 1671504154.0158489, "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": 1671504154.016182, "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": 1671504154.016841, "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": 1671504154.018388, "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": 1671504154.042627, "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": 1671504154.043009, "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": 1671504154.045061, "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": 1671504154.0464041, "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": 1671504154.0472581, "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": 1671504154.047523, "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": 1671504154.04791, "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": 1671504154.047997, "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": 1671504154.048471, "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": 1671504154.0486531, "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": 1671504154.049029, "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": 1671504154.0491729, "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": 1671504154.0495548, "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": 1671504154.04967, "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": 1671504154.050186, "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": 1671504154.050383, "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": 1671504154.050752, "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": 1671504154.050859, "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": 1671504154.051235, "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": 1671504154.0513878, "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": 1671504154.051809, "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": 1671504154.052044, "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": 1671504154.052823, "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": 1671504154.053283, "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": 1671504154.053764, "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": 1671504154.053946, "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": 1671504154.0543559, "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": 1671504154.054523, "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": 1671504154.0549178, "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": 1671504154.055116, "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": 1671504154.055488, "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": 1671504154.055664, "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": 1671504154.056012, "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": 1671504154.056127, "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": 1671504154.0565472, "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": 1671504154.056691, "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": 1671504154.0570629, "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": 1671504154.05719, "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": 1671504154.058285, "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": 1671504154.058466, "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": 1671504154.058721, "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": 1671504154.058885, "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": 1671504154.059061, "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": 1671504154.059219, "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": 1671504154.059387, "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": 1671504154.059581, "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": 1671504154.0597482, "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": 1671504154.059907, "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": 1671504154.060074, "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": 1671504154.060221, "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": 1671504154.060384, "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": 1671504154.06057, "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": 1671504154.060993, "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": 1671504154.061138, "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": 1671504154.061507, "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": 1671504154.06162, "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": 1671504154.0621, "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": 1671504154.0623941, "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": 1671504154.0625558, "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": 1671504154.06322, "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": 1671504154.0634, "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": 1671504154.0637288, "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": 1671504154.064167, "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": 1671504154.064329, "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": 1671504154.0648232, "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": 1671504154.065079, "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": 1671504154.0654662, "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": 1671504154.0656042, "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": 1671504154.066061, "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": 1671504154.066283, "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": 1671504154.066457, "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": 1671504154.066654, "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": 1671504154.067269, "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": 1671504154.067462, "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": 1671504154.067616, "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": 1671504154.0677278, "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": 1671504154.067904, "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": 1671504154.067988, "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": 1671504154.0681758, "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": 1671504154.068376, "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": 1671504154.0689468, "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": 1671504154.069191, "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": 1671504154.069375, "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": 1671504154.069846, "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": 1671504154.0732448, "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": 1671504154.073458, "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": 1671504154.073709, "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": 1671504154.074027, "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": 1671504154.0743291, "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": 1671504154.074701, "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": 1671504154.0748968, "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": 1671504154.075147, "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": 1671504154.075339, "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": 1671504154.075504, "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": 1671504154.075716, "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": 1671504154.076043, "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": 1671504154.076343, "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": 1671504154.0769799, "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": 1671504154.07734, "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": 1671504154.077512, "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": 1671504154.0777369, "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": 1671504154.078309, "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": 1671504154.078807, "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": 1671504154.080608, "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": 1671504154.0807328, "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": 1671504154.0809112, "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": 1671504154.081053, "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": 1671504154.0814521, "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": 1671504154.081664, "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": 1671504154.0817769, "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": 1671504154.082031, "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": 1671504154.08224, "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": 1671504154.0824971, "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": 1671504154.082693, "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": 1671504154.0829282, "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": 1671504154.083612, "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": 1671504154.08388, "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": 1671504154.0841322, "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": 1671504154.084368, "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": 1671504154.0855172, "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": 1671504154.086294, "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": 1671504154.086476, "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": 1671504154.086689, "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": 1671504154.086866, "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": 1671504154.087156, "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": 1671504154.087646, "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": 1671504154.089131, "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": 1671504154.089396, "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": 1671504154.089586, "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": 1671504154.0897448, "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": 1671504154.0899231, "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": 1671504154.090164, "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": 1671504154.090369, "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": 1671504154.0906749, "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": 1671504154.0908642, "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": 1671504154.0910249, "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": 1671504154.092711, "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": 1671504154.0929642, "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": 1671504154.0932841, "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": 1671504154.093468, "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": 1671504154.0938141, "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": 1671504154.094044, "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": 1671504154.09465, "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": 1671504154.094906, "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": 1671504154.095697, "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": 1671504154.0971992, "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": 1671504154.0976808, "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": 1671504154.09814, "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": 1671504154.098546, "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": 1671504154.09862, "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": 1671504154.099203, "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": 1671504154.099435, "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": 1671504154.099722, "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": 1671504154.099995, "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/linkedin/dbt_linkedin/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": 1671504154.1004212, "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/linkedin/dbt_linkedin/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": 1671504154.1009831, "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/linkedin/dbt_linkedin/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": 1671504154.1015198, "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/linkedin/dbt_linkedin/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": 1671504154.102178, "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/linkedin/dbt_linkedin/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": 1671504154.1025789, "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/linkedin/dbt_linkedin/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": 1671504154.1029088, "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/linkedin/dbt_linkedin/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": 1671504154.103987, "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/linkedin/dbt_linkedin/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": 1671504154.105021, "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/linkedin/dbt_linkedin/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": 1671504154.105949, "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/linkedin/dbt_linkedin/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": 1671504154.107017, "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/linkedin/dbt_linkedin/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": 1671504154.1077309, "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/linkedin/dbt_linkedin/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": 1671504154.108073, "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/linkedin/dbt_linkedin/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": 1671504154.1088471, "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/linkedin/dbt_linkedin/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": 1671504154.109677, "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/linkedin/dbt_linkedin/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": 1671504154.110241, "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/linkedin/dbt_linkedin/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": 1671504154.110723, "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/linkedin/dbt_linkedin/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": 1671504154.111425, "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/linkedin/dbt_linkedin/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": 1671504154.1118999, "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/linkedin/dbt_linkedin/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": 1671504154.112513, "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/linkedin/dbt_linkedin/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": 1671504154.1129758, "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/linkedin/dbt_linkedin/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": 1671504154.1134999, "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/linkedin/dbt_linkedin/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": 1671504154.1139631, "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/linkedin/dbt_linkedin/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": 1671504154.114632, "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/linkedin/dbt_linkedin/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": 1671504154.115275, "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/linkedin/dbt_linkedin/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": 1671504154.115874, "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/linkedin/dbt_linkedin/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": 1671504154.116218, "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/linkedin/dbt_linkedin/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": 1671504154.1166878, "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/linkedin/dbt_linkedin/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": 1671504154.1170409, "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/linkedin/dbt_linkedin/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": 1671504154.1177201, "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/linkedin/dbt_linkedin/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": 1671504154.118519, "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/linkedin/dbt_linkedin/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": 1671504154.1194282, "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/linkedin/dbt_linkedin/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": 1671504154.120325, "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/linkedin/dbt_linkedin/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": 1671504154.1212459, "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/linkedin/dbt_linkedin/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": 1671504154.1221828, "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/linkedin/dbt_linkedin/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": 1671504154.122828, "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/linkedin/dbt_linkedin/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": 1671504154.123132, "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/linkedin/dbt_linkedin/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": 1671504154.1264708, "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/linkedin/dbt_linkedin/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": 1671504154.128271, "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/linkedin/dbt_linkedin/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": 1671504154.128743, "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/linkedin/dbt_linkedin/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": 1671504154.128936, "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/linkedin/dbt_linkedin/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": 1671504154.129539, "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/linkedin/dbt_linkedin/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": 1671504154.129958, "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/linkedin/dbt_linkedin/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": 1671504154.130172, "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/linkedin/dbt_linkedin/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": 1671504154.130543, "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/linkedin/dbt_linkedin/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": 1671504154.13073, "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/linkedin/dbt_linkedin/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": 1671504154.131513, "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/linkedin/dbt_linkedin/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": 1671504154.132534, "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/linkedin/dbt_linkedin/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": 1671504154.133376, "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/linkedin/dbt_linkedin/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": 1671504154.134007, "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/linkedin/dbt_linkedin/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": 1671504154.1342552, "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/linkedin/dbt_linkedin/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": 1671504154.134634, "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/linkedin/dbt_linkedin/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": 1671504154.1350908, "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/linkedin/dbt_linkedin/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": 1671504154.135455, "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/linkedin/dbt_linkedin/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": 1671504154.1362932, "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/linkedin/dbt_linkedin/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": 1671504154.1372328, "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/linkedin/dbt_linkedin/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": 1671504154.1382, "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/linkedin/dbt_linkedin/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": 1671504154.138628, "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/linkedin/dbt_linkedin/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": 1671504154.138824, "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/linkedin/dbt_linkedin/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": 1671504154.139328, "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/linkedin/dbt_linkedin/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": 1671504154.140082, "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/linkedin/dbt_linkedin/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": 1671504154.141074, "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/linkedin/dbt_linkedin/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": 1671504154.14174, "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/linkedin/dbt_linkedin/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": 1671504154.142067, "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/linkedin/dbt_linkedin/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": 1671504154.14357, "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/linkedin/dbt_linkedin/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": 1671504154.145194, "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/linkedin/dbt_linkedin/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": 1671504154.146713, "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/linkedin/dbt_linkedin/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": 1671504154.1487901, "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/linkedin/dbt_linkedin/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": 1671504154.149248, "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/linkedin/dbt_linkedin/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": 1671504154.149389, "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/linkedin/dbt_linkedin/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": 1671504154.152589, "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/linkedin/dbt_linkedin/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": 1671504154.156385, "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/linkedin/dbt_linkedin/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": 1671504154.156868, "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/linkedin/dbt_linkedin/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": 1671504154.157148, "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/linkedin/dbt_linkedin/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": 1671504154.1580238, "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/linkedin/dbt_linkedin/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": 1671504154.1582541, "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/linkedin/dbt_linkedin/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": 1671504154.1585019, "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/linkedin/dbt_linkedin/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": 1671504154.1587179, "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/linkedin/dbt_linkedin/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": 1671504154.158914, "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/linkedin/dbt_linkedin/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": 1671504154.159101, "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/linkedin/dbt_linkedin/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": 1671504154.159637, "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/linkedin/dbt_linkedin/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": 1671504154.159932, "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/linkedin/dbt_linkedin/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": 1671504154.160425, "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/linkedin/dbt_linkedin/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": 1671504154.161012, "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/linkedin/dbt_linkedin/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": 1671504154.161498, "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/linkedin/dbt_linkedin/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": 1671504154.161879, "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/linkedin/dbt_linkedin/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": 1671504154.163692, "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/linkedin/dbt_linkedin/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": 1671504154.164072, "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/linkedin/dbt_linkedin/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": 1671504154.16493, "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/linkedin/dbt_linkedin/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": 1671504154.165497, "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/linkedin/dbt_linkedin/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": 1671504154.1667662, "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/linkedin/dbt_linkedin/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": 1671504154.168424, "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/linkedin/dbt_linkedin/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": 1671504154.1696599, "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/linkedin/dbt_linkedin/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": 1671504154.170632, "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/linkedin/dbt_linkedin/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": 1671504154.171252, "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/linkedin/dbt_linkedin/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": 1671504154.172075, "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/linkedin/dbt_linkedin/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": 1671504154.17364, "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/linkedin/dbt_linkedin/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": 1671504154.174128, "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/linkedin/dbt_linkedin/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": 1671504154.174593, "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/linkedin/dbt_linkedin/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": 1671504154.1747808, "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/linkedin/dbt_linkedin/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": 1671504154.175277, "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/linkedin/dbt_linkedin/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": 1671504154.1759, "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/linkedin/dbt_linkedin/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": 1671504154.176446, "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/linkedin/dbt_linkedin/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": 1671504154.177114, "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/linkedin/dbt_linkedin/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": 1671504154.177585, "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/linkedin/dbt_linkedin/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": 1671504154.177734, "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/linkedin/dbt_linkedin/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": 1671504154.177873, "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/linkedin/dbt_linkedin/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": 1671504154.178472, "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/linkedin/dbt_linkedin/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": 1671504154.1793149, "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/linkedin/dbt_linkedin/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": 1671504154.180429, "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/linkedin/dbt_linkedin/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": 1671504154.1807082, "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/linkedin/dbt_linkedin/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": 1671504154.181268, "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/linkedin/dbt_linkedin/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": 1671504154.182073, "supported_languages": null}, "macro.linkedin_source.get_creative_history_columns": {"unique_id": "macro.linkedin_source.get_creative_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_creative_history_columns.sql", "original_file_path": "macros/get_creative_history_columns.sql", "name": "get_creative_history_columns", "macro_sql": "{% macro get_creative_history_columns() %}\n\n{% set columns = [\n {\"name\": \"call_to_action_label_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"click_uri\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"version_tag\", \"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", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671504154.1832309, "supported_languages": null}, "macro.linkedin_source.get_campaign_group_history_columns": {"unique_id": "macro.linkedin_source.get_campaign_group_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_campaign_group_history_columns.sql", "original_file_path": "macros/get_campaign_group_history_columns.sql", "name": "get_campaign_group_history_columns", "macro_sql": "{% macro get_campaign_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"account_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"backfilled\", \"datatype\": \"boolean\"},\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"run_schedule_end\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"run_schedule_start\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671504154.1843631, "supported_languages": null}, "macro.linkedin_source.get_ad_analytics_by_campaign_columns": {"unique_id": "macro.linkedin_source.get_ad_analytics_by_campaign_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_ad_analytics_by_campaign_columns.sql", "original_file_path": "macros/get_ad_analytics_by_campaign_columns.sql", "name": "get_ad_analytics_by_campaign_columns", "macro_sql": "{% macro get_ad_analytics_by_campaign_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_int()},\n {\"name\": \"cost_in_local_currency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"cost_in_usd\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"day\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('linkedin_ads__campaign_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671504154.185309, "supported_languages": null}, "macro.linkedin_source.get_campaign_history_columns": {"unique_id": "macro.linkedin_source.get_campaign_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "name": "get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"account_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"audience_expansion_enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"campaign_group_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"cost_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creative_selection\", \"datatype\": dbt.type_string()},\n {\"name\": \"daily_budget_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"daily_budget_currency_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"format\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"locale_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale_language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"objective_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"offsite_delivery_enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"optimization_target_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"run_schedule_end\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"run_schedule_start\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"unit_cost_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"unit_cost_currency_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"version_tag\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671504154.188046, "supported_languages": null}, "macro.linkedin_source.get_ad_analytics_by_creative_columns": {"unique_id": "macro.linkedin_source.get_ad_analytics_by_creative_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_ad_analytics_by_creative_columns.sql", "original_file_path": "macros/get_ad_analytics_by_creative_columns.sql", "name": "get_ad_analytics_by_creative_columns", "macro_sql": "{% macro get_ad_analytics_by_creative_columns() %}\n\n{% set columns = [\n {\"name\": \"clicks\", \"datatype\": dbt.type_int()},\n {\"name\": \"cost_in_local_currency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"cost_in_usd\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"creative_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"day\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('linkedin_ads__creative_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671504154.188994, "supported_languages": null}, "macro.linkedin_source.get_account_history_columns": {"unique_id": "macro.linkedin_source.get_account_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_account_history_columns.sql", "original_file_path": "macros/get_account_history_columns.sql", "name": "get_account_history_columns", "macro_sql": "{% macro get_account_history_columns() %}\n\n{% set columns = [\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"version_tag\", \"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": 1671504154.190055, "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/linkedin/dbt_linkedin/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": 1671504154.19506, "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/linkedin/dbt_linkedin/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": 1671504154.1957529, "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/linkedin/dbt_linkedin/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": 1671504154.196647, "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/linkedin/dbt_linkedin/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": 1671504154.1973991, "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/linkedin/dbt_linkedin/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": 1671504154.19814, "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/linkedin/dbt_linkedin/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": 1671504154.199056, "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/linkedin/dbt_linkedin/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": 1671504154.1993651, "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/linkedin/dbt_linkedin/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": 1671504154.199548, "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/linkedin/dbt_linkedin/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": 1671504154.202701, "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/linkedin/dbt_linkedin/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": 1671504154.2105112, "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/linkedin/dbt_linkedin/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": 1671504154.210786, "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/linkedin/dbt_linkedin/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": 1671504154.2108648, "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/linkedin/dbt_linkedin/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": 1671504154.211547, "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/linkedin/dbt_linkedin/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": 1671504154.213342, "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/linkedin/dbt_linkedin/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": 1671504154.213714, "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/linkedin/dbt_linkedin/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": 1671504154.21401, "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/linkedin/dbt_linkedin/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": 1671504154.214314, "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/linkedin/dbt_linkedin/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": 1671504154.214808, "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/linkedin/dbt_linkedin/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": 1671504154.215039, "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/linkedin/dbt_linkedin/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": 1671504154.215382, "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/linkedin/dbt_linkedin/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": 1671504154.215921, "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/linkedin/dbt_linkedin/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": 1671504154.2169569, "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/linkedin/dbt_linkedin/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": 1671504154.217132, "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/linkedin/dbt_linkedin/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": 1671504154.217325, "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/linkedin/dbt_linkedin/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": 1671504154.217538, "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/linkedin/dbt_linkedin/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": 1671504154.217726, "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/linkedin/dbt_linkedin/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": 1671504154.217907, "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/linkedin/dbt_linkedin/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": 1671504154.218932, "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/linkedin/dbt_linkedin/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": 1671504154.219677, "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/linkedin/dbt_linkedin/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": 1671504154.2208178, "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/linkedin/dbt_linkedin/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": 1671504154.221099, "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/linkedin/dbt_linkedin/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": 1671504154.2213812, "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/linkedin/dbt_linkedin/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": 1671504154.2216792, "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/linkedin/dbt_linkedin/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": 1671504154.221942, "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/linkedin/dbt_linkedin/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": 1671504154.222249, "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/linkedin/dbt_linkedin/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": 1671504154.2225301, "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/linkedin/dbt_linkedin/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": 1671504154.222964, "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/linkedin/dbt_linkedin/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": 1671504154.223211, "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/linkedin/dbt_linkedin/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": 1671504154.2233531, "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/linkedin/dbt_linkedin/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": 1671504154.223466, "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/linkedin/dbt_linkedin/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": 1671504154.224017, "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/linkedin/dbt_linkedin/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": 1671504154.224681, "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/linkedin/dbt_linkedin/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": 1671504154.225528, "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/linkedin/dbt_linkedin/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": 1671504154.2260711, "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/linkedin/dbt_linkedin/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": 1671504154.226206, "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/linkedin/dbt_linkedin/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": 1671504154.226335, "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/linkedin/dbt_linkedin/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": 1671504154.22646, "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/linkedin/dbt_linkedin/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": 1671504154.226675, "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/linkedin/dbt_linkedin/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": 1671504154.229432, "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/linkedin/dbt_linkedin/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": 1671504154.2295911, "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/linkedin/dbt_linkedin/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": 1671504154.2297459, "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/linkedin/dbt_linkedin/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": 1671504154.2298958, "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/linkedin/dbt_linkedin/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": 1671504154.231752, "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/linkedin/dbt_linkedin/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": 1671504154.232825, "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/linkedin/dbt_linkedin/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": 1671504154.23298, "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/linkedin/dbt_linkedin/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": 1671504154.233275, "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/linkedin/dbt_linkedin/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": 1671504154.233557, "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/linkedin/dbt_linkedin/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": 1671504154.233695, "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/linkedin/dbt_linkedin/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": 1671504154.2338188, "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/linkedin/dbt_linkedin/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": 1671504154.2339468, "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/linkedin/dbt_linkedin/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": 1671504154.234535, "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/linkedin/dbt_linkedin/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": 1671504154.235126, "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/linkedin/dbt_linkedin/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": 1671504154.235689, "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/linkedin/dbt_linkedin/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": 1671504154.235893, "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/linkedin/dbt_linkedin/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": 1671504154.236118, "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/linkedin/dbt_linkedin/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": 1671504154.2364538, "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/linkedin/dbt_linkedin/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": 1671504154.2378109, "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/linkedin/dbt_linkedin/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": 1671504154.242267, "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/linkedin/dbt_linkedin/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": 1671504154.242677, "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/linkedin/dbt_linkedin/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": 1671504154.243223, "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/linkedin/dbt_linkedin/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": 1671504154.244873, "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/linkedin/dbt_linkedin/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": 1671504154.245419, "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/linkedin/dbt_linkedin/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": 1671504154.2460558, "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/linkedin/dbt_linkedin/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": 1671504154.246209, "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/linkedin/dbt_linkedin/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": 1671504154.2463639, "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/linkedin/dbt_linkedin/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": 1671504154.2465322, "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/linkedin/dbt_linkedin/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": 1671504154.2466822, "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/linkedin/dbt_linkedin/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": 1671504154.24683, "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/linkedin/dbt_linkedin/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": 1671504154.247576, "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/linkedin/dbt_linkedin/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": 1671504154.2485409, "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/linkedin/dbt_linkedin/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": 1671504154.2492878, "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/linkedin/dbt_linkedin/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": 1671504154.249454, "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/linkedin/dbt_linkedin/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": 1671504154.249608, "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/linkedin/dbt_linkedin/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": 1671504154.249763, "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/linkedin/dbt_linkedin/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": 1671504154.249917, "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/linkedin/dbt_linkedin/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": 1671504154.250156, "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/linkedin/dbt_linkedin/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": 1671504154.250486, "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/linkedin/dbt_linkedin/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": 1671504154.250587, "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/linkedin/dbt_linkedin/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": 1671504154.2506828, "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/linkedin/dbt_linkedin/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": 1671504154.251494, "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/linkedin/dbt_linkedin/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": 1671504154.253021, "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/linkedin/dbt_linkedin/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": 1671504154.255487, "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/linkedin/dbt_linkedin/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": 1671504154.2569978, "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/linkedin/dbt_linkedin/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": 1671504154.257361, "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/linkedin/dbt_linkedin/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": 1671504154.257472, "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/linkedin/dbt_linkedin/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": 1671504154.2575748, "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/linkedin/dbt_linkedin/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": 1671504154.25806, "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/linkedin/dbt_linkedin/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": 1671504154.258534, "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.linkedin_integration_tests.linkedin_campaign_group_history_data": [], "seed.linkedin_integration_tests.linkedin_account_history_data": [], "seed.linkedin_integration_tests.linkedin_campaign_history_data": [], "seed.linkedin_integration_tests.linkedin_creative_history_data": [], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data": [], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data": [], "model.linkedin_source.stg_linkedin_ads__creative_history": ["model.linkedin_source.stg_linkedin_ads__creative_history_tmp", "model.linkedin_source.stg_linkedin_ads__creative_history_tmp"], "model.linkedin_source.stg_linkedin_ads__campaign_history": ["model.linkedin_source.stg_linkedin_ads__campaign_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"], "model.linkedin_source.stg_linkedin_ads__account_history": ["model.linkedin_source.stg_linkedin_ads__account_history_tmp", "model.linkedin_source.stg_linkedin_ads__account_history_tmp"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"], "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": ["seed.linkedin_integration_tests.linkedin_campaign_history_data"], "model.linkedin_source.stg_linkedin_ads__account_history_tmp": ["seed.linkedin_integration_tests.linkedin_account_history_data"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": ["seed.linkedin_integration_tests.linkedin_campaign_group_history_data"], "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": ["seed.linkedin_integration_tests.linkedin_creative_history_data"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"], "model.linkedin.linkedin_ads__campaign_group_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin.linkedin_ads__creative_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__creative_history"], "model.linkedin.linkedin_ads__campaign_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin.linkedin_ads__account_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin.linkedin_ads__url_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474": ["model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227": ["model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66": ["model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2": ["model.linkedin_source.stg_linkedin_ads__campaign_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469": ["model.linkedin_source.stg_linkedin_ads__campaign_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793": ["model.linkedin_source.stg_linkedin_ads__campaign_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0": ["model.linkedin_source.stg_linkedin_ads__account_history"], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81": ["model.linkedin_source.stg_linkedin_ads__account_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce": ["model.linkedin_source.stg_linkedin_ads__account_history"], "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842": ["model.linkedin.linkedin_ads__account_report"], "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53": ["model.linkedin.linkedin_ads__account_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c": ["model.linkedin.linkedin_ads__account_report"], "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1": ["model.linkedin.linkedin_ads__campaign_report"], "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15": ["model.linkedin.linkedin_ads__campaign_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3": ["model.linkedin.linkedin_ads__campaign_report"], "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b": ["model.linkedin.linkedin_ads__campaign_group_report"], "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf": ["model.linkedin.linkedin_ads__campaign_group_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6": ["model.linkedin.linkedin_ads__campaign_group_report"], "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020": ["model.linkedin.linkedin_ads__creative_report"], "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889": ["model.linkedin.linkedin_ads__creative_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f": ["model.linkedin.linkedin_ads__creative_report"], "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315": ["model.linkedin.linkedin_ads__url_report"], "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2": ["model.linkedin.linkedin_ads__url_report"], "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb": ["model.linkedin.linkedin_ads__url_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d": ["model.linkedin.linkedin_ads__url_report"], "source.linkedin_source.linkedin.ad_analytics_by_creative": [], "source.linkedin_source.linkedin.creative_history": [], "source.linkedin_source.linkedin.campaign_history": [], "source.linkedin_source.linkedin.campaign_group_history": [], "source.linkedin_source.linkedin.account_history": [], "source.linkedin_source.linkedin.ad_analytics_by_campaign": []}, "child_map": {"seed.linkedin_integration_tests.linkedin_campaign_group_history_data": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"], "seed.linkedin_integration_tests.linkedin_account_history_data": ["model.linkedin_source.stg_linkedin_ads__account_history_tmp"], "seed.linkedin_integration_tests.linkedin_campaign_history_data": ["model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"], "seed.linkedin_integration_tests.linkedin_creative_history_data": ["model.linkedin_source.stg_linkedin_ads__creative_history_tmp"], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"], "model.linkedin_source.stg_linkedin_ads__creative_history": ["model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66", "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474", "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227"], "model.linkedin_source.stg_linkedin_ads__campaign_history": ["model.linkedin.linkedin_ads__account_report", "model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": ["model.linkedin.linkedin_ads__account_report", "model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history": ["model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea"], "model.linkedin_source.stg_linkedin_ads__account_history": ["model.linkedin.linkedin_ads__account_report", "model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce", "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0", "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": ["model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": ["model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin_source.stg_linkedin_ads__account_history_tmp": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__account_history"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": ["model.linkedin_source.stg_linkedin_ads__creative_history", "model.linkedin_source.stg_linkedin_ads__creative_history"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "model.linkedin.linkedin_ads__campaign_group_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6", "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf", "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b"], "model.linkedin.linkedin_ads__creative_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f", "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889", "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020"], "model.linkedin.linkedin_ads__campaign_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3", "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15", "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1"], "model.linkedin.linkedin_ads__account_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c", "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842", "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53"], "model.linkedin.linkedin_ads__url_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d", "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb", "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2", "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b": [], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410": [], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a": [], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d": [], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474": [], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da": [], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0": [], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce": [], "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842": [], "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c": [], "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1": [], "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3": [], "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b": [], "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6": [], "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020": [], "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f": [], "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315": [], "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2": [], "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d": [], "source.linkedin_source.linkedin.ad_analytics_by_creative": [], "source.linkedin_source.linkedin.creative_history": [], "source.linkedin_source.linkedin.campaign_history": [], "source.linkedin_source.linkedin.campaign_group_history": [], "source.linkedin_source.linkedin.account_history": [], "source.linkedin_source.linkedin.ad_analytics_by_campaign": []}} \ 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": "2023-01-09T15:29:07.029737Z", "invocation_id": "413e08a3-98c2-41ac-8950-bf784e480296", "env": {}, "project_id": "f1bddc747961ccc49643c2a9639b67aa", "user_id": "8929baf0-9bc1-477e-9a57-eb8b0db4da62", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.linkedin_integration_tests.linkedin_campaign_group_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": {"created_time": "timestamp", "last_modified_time": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_campaign_group_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_group_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_campaign_group_history_data.csv", "original_file_path": "seeds/linkedin_campaign_group_history_data.csv", "name": "linkedin_campaign_group_history_data", "alias": "linkedin_campaign_group_history_data", "checksum": {"name": "sha256", "checksum": "a3e2f426d56d779f1bcb3013b2d4862e7a8203c0372c4892e598165fedab1744"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp"}}, "created_at": 1673278136.70349, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_group_history_data\""}, "seed.linkedin_integration_tests.linkedin_account_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": {"created_time": "timestamp", "last_modified_time": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_account_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_account_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_account_history_data.csv", "original_file_path": "seeds/linkedin_account_history_data.csv", "name": "linkedin_account_history_data", "alias": "linkedin_account_history_data", "checksum": {"name": "sha256", "checksum": "e00ceef7b82a006c9fb463fe928e58f1d0bdaeddb0541508934c62d0142084fb"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp"}}, "created_at": 1673278136.7101161, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_account_history_data\""}, "seed.linkedin_integration_tests.linkedin_campaign_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": {"created_time": "timestamp", "last_modified_time": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_campaign_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_campaign_history_data.csv", "original_file_path": "seeds/linkedin_campaign_history_data.csv", "name": "linkedin_campaign_history_data", "alias": "linkedin_campaign_history_data", "checksum": {"name": "sha256", "checksum": "90cdf3c013456ff4a40f502e0d55fa10be2dfdb269b5b79b41671ab4558ae879"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp"}}, "created_at": 1673278136.711393, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_history_data\""}, "seed.linkedin_integration_tests.linkedin_creative_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": {"created_time": "timestamp", "last_modified_time": "timestamp", "click_uri": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_creative_history_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_creative_history_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_creative_history_data.csv", "original_file_path": "seeds/linkedin_creative_history_data.csv", "name": "linkedin_creative_history_data", "alias": "linkedin_creative_history_data", "checksum": {"name": "sha256", "checksum": "60d568d212f155df35c86f9d39572cf55a733c53598016adb0aa9b4df79ce2e8"}, "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": {"column_types": {"created_time": "timestamp", "last_modified_time": "timestamp", "click_uri": "{{ 'string' if target.type in ('bigquery','spark','databricks') else 'varchar' }}"}}, "created_at": 1673278136.712746, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_creative_history_data\""}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_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": {"day": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_ad_analytics_by_creative_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_ad_analytics_by_creative_data.csv", "original_file_path": "seeds/linkedin_ad_analytics_by_creative_data.csv", "name": "linkedin_ad_analytics_by_creative_data", "alias": "linkedin_ad_analytics_by_creative_data", "checksum": {"name": "sha256", "checksum": "90a1a324923b47307989ab10594f537f8c45262ffcdfd8ffbe09bae7f05760f7"}, "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": {"column_types": {"day": "timestamp"}}, "created_at": 1673278136.714124, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_creative_data\""}, "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_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": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "linkedin_integration_tests_2", "fqn": ["linkedin_integration_tests", "linkedin_ad_analytics_by_campaign_data"], "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data", "raw_code": "", "language": "sql", "package_name": "linkedin_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests", "path": "linkedin_ad_analytics_by_campaign_data.csv", "original_file_path": "seeds/linkedin_ad_analytics_by_campaign_data.csv", "name": "linkedin_ad_analytics_by_campaign_data", "alias": "linkedin_ad_analytics_by_campaign_data", "checksum": {"name": "sha256", "checksum": "a6b72fcf11043561ec04bae0035659363e992cd11f8ed5376f056b7f4e5b5b32"}, "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": {}, "created_at": 1673278136.715412, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_campaign_data\""}, "model.linkedin_source.stg_linkedin_ads__creative_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_creative_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.dbt_utils.get_url_parameter"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history_tmp", "model.linkedin_source.stg_linkedin_ads__creative_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__creative_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__creative_history_tmp') }}\n\n), macro as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__creative_history_tmp')),\n staging_columns=get_creative_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select\n id as creative_id,\n campaign_id,\n type,\n cast(version_tag as numeric) as version_tag,\n status,\n click_uri,\n call_to_action_label_type,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n), url_fields as (\n\n select \n *,\n {{ dbt.split_part('click_uri', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('click_uri') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('click_uri') }} as url_path,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_source') }} as utm_source,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_medium') }} as utm_medium,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_campaign') }} as utm_campaign,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_content') }} as utm_content,\n {{ dbt_utils.get_url_parameter('click_uri', 'utm_term') }} as utm_term\n \n from fields\n)\n\nselect *\nfrom url_fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__creative_history.sql", "original_file_path": "models/stg_linkedin_ads__creative_history.sql", "name": "stg_linkedin_ads__creative_history", "alias": "stg_linkedin_ads__creative_history", "checksum": {"name": "sha256", "checksum": "d00cfaa4090be843e4157a73bf2e05ae970fe6fa654b234cd2d05b304c0c36e0"}, "tags": [], "refs": [["stg_linkedin_ads__creative_history_tmp"], ["stg_linkedin_ads__creative_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of a creative.", "columns": {"creative_id": {"name": "creative_id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the creative was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign the creative belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text with Sponsored Link to landing page on your site.\nSPONSORED_STATUS_UPDATE - Sponsored status update from a profile page.\nSPONSORED_INMAILS - Single message ad delivered to the member's inbox\nSPONSORED_MESSAGE - Conversation ad containing a tree of pre-determined messages delivered to the member's inbox\nSPONSORED_VIDEO - Sponsored videos.\nSPONSORED_UPDATE_CAROUSEL - Sponsored Carousels\nFOLLOW_COMPANY_V2 - Dynamic Follow Ad\nSPOTLIGHT_V2 - Dynamic Spotlight Ad\nJOBS_V2 - Dynamic Job Ad\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Creative creation is complete and creative is available for review and serve.\nPAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation.\nDRAFT - Creative creation is incomplete and may still be edited.\nARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI.\nCANCELED - Creative is permanently canceled.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "call_to_action_label_type": {"name": "call_to_action_label_type", "description": "The labeled call-to-action on this ad.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the cretive.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__creative_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.989024, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history_tmp\"\n\n), macro as (\n\n select \n \n cast(null as TEXT) as \n \n call_to_action_label_type\n \n , \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n click_uri\n \n as \n \n click_uri\n \n, \n \n \n created_time\n \n as \n \n created_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n version_tag\n \n as \n \n version_tag\n \n\n\n\n from base\n\n), fields as (\n\n select\n id as creative_id,\n campaign_id,\n type,\n cast(version_tag as numeric) as version_tag,\n status,\n click_uri,\n call_to_action_label_type,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n), url_fields as (\n\n select \n *,\n \n\n \n \n\n split_part(\n click_uri,\n '?',\n 1\n )\n\n\n \n\n as base_url,\n \n \n cast(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n \n\n replace(\n \n\n replace(\n \n\n replace(\n click_uri,\n 'android-app://',\n ''\n )\n\n\n,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n,\n '/',\n 1\n )\n\n\n \n\n,\n '?',\n 1\n )\n\n\n \n\n as TEXT)\n as url_host,\n '/' || \n \n cast(\n\n \n \n\n split_part(\n \n\n right(\n \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n,\n \n\n length(\n \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n\n )-coalesce(\n nullif(\n\n position(\n '/' in \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n\n ), 0),\n \n\n position(\n '?' in \n\n replace(\n \n\n replace(\n click_uri,\n 'http://',\n ''\n )\n\n\n,\n 'https://',\n ''\n )\n\n\n\n ) - 1\n )\n ),\n '?',\n 1\n )\n\n\n \n\n as TEXT)\n as url_path,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_source=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_source,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_medium=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_medium,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_campaign=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_campaign,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_content=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_content,\n nullif(\n\n \n \n\n split_part(\n \n\n \n \n\n split_part(\n click_uri,\n 'utm_term=',\n 2\n )\n\n\n \n\n,\n '&',\n 1\n )\n\n\n \n\n,'') as utm_term\n \n from fields\n)\n\nselect *\nfrom url_fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\""}, "model.linkedin_source.stg_linkedin_ads__campaign_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__campaign_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__campaign_history_tmp') }}\n\n), macro as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select \n id as campaign_id,\n name as campaign_name,\n cast(version_tag as numeric) as version_tag,\n campaign_group_id,\n account_id,\n status,\n type,\n cost_type,\n creative_selection,\n daily_budget_amount,\n daily_budget_currency_code,\n unit_cost_amount,\n unit_cost_currency_code,\n format,\n locale_country,\n locale_language,\n objective_type,\n optimization_target_type,\n audience_expansion_enabled as is_audience_expansion_enabled,\n offsite_delivery_enabled as is_offsite_delivery_enabled,\n cast(run_schedule_start as {{ dbt.type_timestamp() }}) as run_schedule_start_at,\n cast(run_schedule_end as {{ dbt.type_timestamp() }}) as run_schedule_end_at,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__campaign_history.sql", "original_file_path": "models/stg_linkedin_ads__campaign_history.sql", "name": "stg_linkedin_ads__campaign_history", "alias": "stg_linkedin_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "12f98866db796269913da635f3597191300af87f91d3e018768b16c927e8f77f"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history_tmp"], ["stg_linkedin_ads__campaign_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of a campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "The ID of the campaign group the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_audience_expansion_enabled": {"name": "is_audience_expansion_enabled", "description": "Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_type": {"name": "cost_type", "description": "CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000.\nCPC- Cost per individual click on the associated link.\nCPV- Cost per view for video ads.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_selection": {"name": "creative_selection", "description": "ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible.\nOPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_amount": {"name": "daily_budget_amount", "description": "Maximum amount to spend per day UTC. The amount of money as a real number string.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_currency_code": {"name": "daily_budget_currency_code", "description": "ISO currency code. The currency must match that of the parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "format": {"name": "format", "description": "The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_country": {"name": "locale_country", "description": "Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_language": {"name": "locale_language", "description": "Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_offsite_delivery_enabled": {"name": "is_offsite_delivery_enabled", "description": "Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites.\t(default will be \"True\" from June 30, 2022)\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "optimization_target_type": {"name": "optimization_target_type", "description": "Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn.\nSPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed.\nSPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox.\nDYNAMIC - Ads that are dynamically personalized.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_amount": {"name": "unit_cost_amount", "description": "This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_currency_code": {"name": "unit_cost_currency_code", "description": "Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__campaign_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.9928708, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history_tmp\"\n\n), macro as (\n\n select \n \n \n \n account_id\n \n as \n \n account_id\n \n, \n cast(null as boolean) as \n \n audience_expansion_enabled\n \n , \n \n \n campaign_group_id\n \n as \n \n campaign_group_id\n \n, \n cast(null as TEXT) as \n \n cost_type\n \n , \n \n \n created_time\n \n as \n \n created_time\n \n, \n cast(null as TEXT) as \n \n creative_selection\n \n , \n cast(null as FLOAT) as \n \n daily_budget_amount\n \n , \n cast(null as TEXT) as \n \n daily_budget_currency_code\n \n , \n cast(null as TEXT) as \n \n format\n \n , \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n cast(null as TEXT) as \n \n locale_country\n \n , \n cast(null as TEXT) as \n \n locale_language\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as TEXT) as \n \n objective_type\n \n , \n cast(null as boolean) as \n \n offsite_delivery_enabled\n \n , \n cast(null as TEXT) as \n \n optimization_target_type\n \n , \n cast(null as TIMESTAMP) as \n \n run_schedule_end\n \n , \n cast(null as TIMESTAMP) as \n \n run_schedule_start\n \n , \n cast(null as TEXT) as \n \n status\n \n , \n cast(null as TEXT) as \n \n type\n \n , \n cast(null as FLOAT) as \n \n unit_cost_amount\n \n , \n cast(null as TEXT) as \n \n unit_cost_currency_code\n \n , \n \n \n version_tag\n \n as \n \n version_tag\n \n\n\n\n from base\n\n), fields as (\n\n select \n id as campaign_id,\n name as campaign_name,\n cast(version_tag as numeric) as version_tag,\n campaign_group_id,\n account_id,\n status,\n type,\n cost_type,\n creative_selection,\n daily_budget_amount,\n daily_budget_currency_code,\n unit_cost_amount,\n unit_cost_currency_code,\n format,\n locale_country,\n locale_language,\n objective_type,\n optimization_target_type,\n audience_expansion_enabled as is_audience_expansion_enabled,\n offsite_delivery_enabled as is_offsite_delivery_enabled,\n cast(run_schedule_start as TIMESTAMP) as run_schedule_start_at,\n cast(run_schedule_end as TIMESTAMP) as run_schedule_end_at,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_ad_analytics_by_campaign_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.date_trunc", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__ad_analytics_by_campaign"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_linkedin_ads__ad_analytics_by_campaign_tmp') }}\n),\n\nmacro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__ad_analytics_by_campaign_tmp')),\n staging_columns=get_ad_analytics_by_campaign_columns()\n )\n }}\n from base\n),\n\nfields as (\n \n select \n {{ dbt.date_trunc('day', 'day') }} as date_day,\n campaign_id,\n clicks,\n impressions,\n {% if var('linkedin_ads__use_local_currency', false) %}\n cost_in_local_currency as cost\n {% else %}\n cost_in_usd as cost\n {% endif %}\n\n {{ fivetran_utils.fill_pass_through_columns('linkedin_ads__campaign_passthrough_metrics') }}\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__ad_analytics_by_campaign.sql", "original_file_path": "models/stg_linkedin_ads__ad_analytics_by_campaign.sql", "name": "stg_linkedin_ads__ad_analytics_by_campaign", "alias": "stg_linkedin_ads__ad_analytics_by_campaign", "checksum": {"name": "sha256", "checksum": "b0bf02e1776326897d77e8060a8f30689fa628b67e826fa86198aef533c31569"}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign_tmp"], ["stg_linkedin_ads__ad_analytics_by_campaign_tmp"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the campaign level.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the related creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__ad_analytics_by_campaign.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.985837, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign_tmp\"\n),\n\nmacro as (\n\n select\n \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n clicks\n \n as \n \n clicks\n \n, \n \n \n cost_in_local_currency\n \n as \n \n cost_in_local_currency\n \n, \n \n \n cost_in_usd\n \n as \n \n cost_in_usd\n \n, \n \n \n day\n \n as \n \n day\n \n, \n \n \n impressions\n \n as \n \n impressions\n \n\n\n\n from base\n),\n\nfields as (\n \n select \n date_trunc('day', day) as date_day,\n campaign_id,\n clicks,\n impressions,\n \n cost_in_usd as cost\n \n\n \n\n\n\n\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\""}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_campaign_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__campaign_group_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__campaign_group_history_tmp') }}\n\n), macro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__campaign_group_history_tmp')),\n staging_columns=get_campaign_group_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select \n id as campaign_group_id,\n name as campaign_group_name,\n account_id,\n status,\n backfilled as is_backfilled,\n cast(run_schedule_start as {{ dbt.type_timestamp() }}) as run_schedule_start_at,\n cast(run_schedule_end as {{ dbt.type_timestamp() }}) as run_schedule_end_at,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__campaign_group_history.sql", "original_file_path": "models/stg_linkedin_ads__campaign_group_history.sql", "name": "stg_linkedin_ads__campaign_group_history", "alias": "stg_linkedin_ads__campaign_group_history", "checksum": {"name": "sha256", "checksum": "9e4b57accd4f0a428f53d1b953c3c9dc25d6b5fbf4255f3a224f071f35474b66"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history_tmp"], ["stg_linkedin_ads__campaign_group_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of a campaign group.", "columns": {"campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign group belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign group was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_backfilled": {"name": "is_backfilled", "description": "Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__campaign_group_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.995614, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history_tmp\"\n\n), macro as (\n\n select\n \n \n \n account_id\n \n as \n \n account_id\n \n, \n cast(null as boolean) as \n \n backfilled\n \n , \n \n \n created_time\n \n as \n \n created_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n \n \n name\n \n as \n \n name\n \n, \n cast(null as TIMESTAMP) as \n \n run_schedule_end\n \n , \n cast(null as TIMESTAMP) as \n \n run_schedule_start\n \n , \n cast(null as TEXT) as \n \n status\n \n \n\n\n from base\n\n), fields as (\n\n select \n id as campaign_group_id,\n name as campaign_group_name,\n account_id,\n status,\n backfilled as is_backfilled,\n cast(run_schedule_start as TIMESTAMP) as run_schedule_start_at,\n cast(run_schedule_end as TIMESTAMP) as run_schedule_end_at,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\""}, "model.linkedin_source.stg_linkedin_ads__account_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_account_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history_tmp", "model.linkedin_source.stg_linkedin_ads__account_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__account_history"], "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__account_history_tmp') }}\n\n), macro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__account_history_tmp')),\n staging_columns=get_account_history_columns()\n )\n }}\n from base\n\n), fields as (\n\n select \n id as account_id,\n name as account_name,\n currency,\n cast(version_tag as numeric) as version_tag,\n status,\n type,\n cast(last_modified_time as {{ dbt.type_timestamp() }}) as last_modified_at,\n cast(created_time as {{ dbt.type_timestamp() }}) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__account_history.sql", "original_file_path": "models/stg_linkedin_ads__account_history.sql", "name": "stg_linkedin_ads__account_history", "alias": "stg_linkedin_ads__account_history", "checksum": {"name": "sha256", "checksum": "60047b6cc68c2bee2b8c25f07872167514305c30028cb0a589f55d82721f8593"}, "tags": [], "refs": [["stg_linkedin_ads__account_history_tmp"], ["stg_linkedin_ads__account_history_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a 'version' of an account.", "columns": {"account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the account was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Account is active; this is the default state\nCANCELLED - Account has been permanently cancelled\nDRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving\nPENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending\nREMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "BUSINESS - This is the only value allowed when creating accounts through the API.\nENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_latest_version": {"name": "is_latest_version", "description": "Boolean of whether the record is the latest version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__account_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.9974568, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history_tmp\"\n\n), macro as (\n\n select\n \n \n \n created_time\n \n as \n \n created_time\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n last_modified_time\n \n as \n \n last_modified_time\n \n, \n \n \n name\n \n as \n \n name\n \n, \n cast(null as TEXT) as \n \n status\n \n , \n cast(null as TEXT) as \n \n type\n \n , \n \n \n version_tag\n \n as \n \n version_tag\n \n\n\n\n from base\n\n), fields as (\n\n select \n id as account_id,\n name as account_name,\n currency,\n cast(version_tag as numeric) as version_tag,\n status,\n type,\n cast(last_modified_time as TIMESTAMP) as last_modified_at,\n cast(created_time as TIMESTAMP) as created_at,\n row_number() over (partition by id order by last_modified_time desc) = 1 as is_latest_version\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.linkedin_source.get_ad_analytics_by_creative_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.date_trunc", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "stg_linkedin_ads__ad_analytics_by_creative"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_linkedin_ads__ad_analytics_by_creative_tmp') }}\n\n), macro as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_linkedin_ads__ad_analytics_by_creative_tmp')),\n staging_columns=get_ad_analytics_by_creative_columns()\n )\n }}\n from base\n\n), fields as (\n\n select\n {{ dbt.date_trunc('day', 'day') }} as date_day,\n creative_id,\n clicks, \n impressions,\n {% if var('linkedin_ads__use_local_currency', false) %}\n cost_in_local_currency as cost\n {% else %}\n cost_in_usd as cost\n {% endif %}\n\n {{ fivetran_utils.fill_pass_through_columns('linkedin_ads__creative_passthrough_metrics') }}\n\n from macro\n\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "stg_linkedin_ads__ad_analytics_by_creative.sql", "original_file_path": "models/stg_linkedin_ads__ad_analytics_by_creative.sql", "name": "stg_linkedin_ads__ad_analytics_by_creative", "alias": "stg_linkedin_ads__ad_analytics_by_creative", "checksum": {"name": "sha256", "checksum": "b5f5b1df9cc38a98aa8438602b219af4468b1493711e5b3ee01fb8836c61d2de"}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative_tmp"], ["stg_linkedin_ads__ad_analytics_by_creative_tmp"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the creative level.", "columns": {"creative_id": {"name": "creative_id", "description": "The ID of the related creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin_source://models/stg_linkedin.yml", "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin_ads__ad_analytics_by_creative.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.984509, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative_tmp\"\n\n), macro as (\n\n select\n \n \n \n clicks\n \n as \n \n clicks\n \n, \n \n \n cost_in_local_currency\n \n as \n \n cost_in_local_currency\n \n, \n \n \n cost_in_usd\n \n as \n \n cost_in_usd\n \n, \n \n \n creative_id\n \n as \n \n creative_id\n \n, \n \n \n day\n \n as \n \n day\n \n, \n \n \n impressions\n \n as \n \n impressions\n \n\n\n\n from base\n\n), fields as (\n\n select\n date_trunc('day', day) as date_day,\n creative_id,\n clicks, \n impressions,\n \n cost_in_usd as cost\n \n\n \n\n\n\n\n\n from macro\n\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__ad_analytics_by_creative_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('ad_analytics_by_creative') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__ad_analytics_by_creative_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__ad_analytics_by_creative_tmp.sql", "name": "stg_linkedin_ads__ad_analytics_by_creative_tmp", "alias": "stg_linkedin_ads__ad_analytics_by_creative_tmp", "checksum": {"name": "sha256", "checksum": "b1140ca3ef37dcf51382d1d423a866f8e99ab568e995419aaa0d6cc46ba9e2c2"}, "tags": [], "refs": [["linkedin_ad_analytics_by_creative_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__ad_analytics_by_creative_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.834274, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_creative_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative_tmp\""}, "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_campaign_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__campaign_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('campaign_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__campaign_history_tmp.sql", "name": "stg_linkedin_ads__campaign_history_tmp", "alias": "stg_linkedin_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "cebe89ef38c2b2a3e4c78f3a30350598b00910af0597c348f07c9e2d29591441"}, "tags": [], "refs": [["linkedin_campaign_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__campaign_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.838938, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__account_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_account_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__account_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('account_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__account_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__account_history_tmp.sql", "name": "stg_linkedin_ads__account_history_tmp", "alias": "stg_linkedin_ads__account_history_tmp", "checksum": {"name": "sha256", "checksum": "d7ffa4b7ad250c8643b99abf7d1ee1099a1b01e847424247f469fb8b49bac5b9"}, "tags": [], "refs": [["linkedin_account_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__account_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.859301, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_account_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_campaign_group_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__campaign_group_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('campaign_group_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__campaign_group_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__campaign_group_history_tmp.sql", "name": "stg_linkedin_ads__campaign_group_history_tmp", "alias": "stg_linkedin_ads__campaign_group_history_tmp", "checksum": {"name": "sha256", "checksum": "704cfe15aec2c0f1de75b8c78a082b45ae6fa6a03198dc210d8eeacb8bd643b8"}, "tags": [], "refs": [["linkedin_campaign_group_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__campaign_group_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.8694122, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_campaign_group_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_creative_history_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__creative_history_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect *\nfrom {{ var('creative_history') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__creative_history_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__creative_history_tmp.sql", "name": "stg_linkedin_ads__creative_history_tmp", "alias": "stg_linkedin_ads__creative_history_tmp", "checksum": {"name": "sha256", "checksum": "0b886b1ffe53a073e6123a79cc2dd4b0576178d82e38be84fddc1f70e8b3d0fc"}, "tags": [], "refs": [["linkedin_creative_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__creative_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.889459, "compiled_code": "\n\nselect *\nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_creative_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history_tmp\""}, "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads_source", "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": "linkedin_integration_tests_2_linkedin_ads_source", "fqn": ["linkedin_source", "tmp", "stg_linkedin_ads__ad_analytics_by_campaign_tmp"], "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nselect * \nfrom {{ var('ad_analytics_by_campaign') }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "tmp/stg_linkedin_ads__ad_analytics_by_campaign_tmp.sql", "original_file_path": "models/tmp/stg_linkedin_ads__ad_analytics_by_campaign_tmp.sql", "name": "stg_linkedin_ads__ad_analytics_by_campaign_tmp", "alias": "stg_linkedin_ads__ad_analytics_by_campaign_tmp", "checksum": {"name": "sha256", "checksum": "03a126189ee0a2fe1d514ff02883403a1c9e8d8f9fe928262c338b61246cd7ef"}, "tags": [], "refs": [["linkedin_ad_analytics_by_campaign_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/tmp/stg_linkedin_ads__ad_analytics_by_campaign_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "linkedin_ads_source", "enabled": true}, "created_at": 1673278136.899147, "compiled_code": "\n\nselect * \nfrom \"postgres\".\"linkedin_integration_tests_2\".\"linkedin_ad_analytics_by_campaign_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign_tmp\""}, "model.linkedin.linkedin_ads__campaign_group_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__campaign_group_report"], "unique_id": "model.linkedin.linkedin_ads__campaign_group_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith campaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_campaign') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign_group.status,\n account.currency,\n campaign_group.is_backfilled,\n campaign_group.run_schedule_start_at,\n campaign_group.run_schedule_end_at,\n campaign_group.last_modified_at,\n campaign_group.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__campaign_passthrough_metrics', transform='sum') }}\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=12) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__campaign_group_report.sql", "original_file_path": "models/linkedin_ads__campaign_group_report.sql", "name": "linkedin_ads__campaign_group_report", "alias": "linkedin_ads__campaign_group_report", "checksum": {"name": "sha256", "checksum": "bc4b9b9b612d1fbbecffc8059005e832e333df998e1b9aad50a3a2dc71125885"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the campaign group level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign group was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_backfilled": {"name": "is_backfilled", "description": "Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__campaign_group_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1673278137.070932, "compiled_code": "\n\nwith campaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign_group.status,\n account.currency,\n campaign_group.is_backfilled,\n campaign_group.run_schedule_start_at,\n campaign_group.run_schedule_end_at,\n campaign_group.last_modified_at,\n campaign_group.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\""}, "model.linkedin.linkedin_ads__creative_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__creative_report"], "unique_id": "model.linkedin.linkedin_ads__creative_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith creative as (\n\n select *\n from {{ var('creative_history') }}\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_creative') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n creative.type,\n creative.click_uri,\n creative.status as creative_status,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n creative.call_to_action_label_type,\n account.currency,\n creative.last_modified_at,\n creative.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__creative_passthrough_metrics', transform='sum') }}\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=18) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__creative_report.sql", "original_file_path": "models/linkedin_ads__creative_report.sql", "name": "linkedin_ads__creative_report", "alias": "linkedin_ads__creative_report", "checksum": {"name": "sha256", "checksum": "ad0eb0c1b25863f9e362dc4aa0d568a06f4a12bed2bd47cfb6bb4cb51ac658d3"}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the creative level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_id": {"name": "creative_id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the creative was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text with Sponsored Link to landing page on your site.\nSPONSORED_STATUS_UPDATE - Sponsored status update from a profile page.\nSPONSORED_INMAILS - Single message ad delivered to the member's inbox\nSPONSORED_MESSAGE - Conversation ad containing a tree of pre-determined messages delivered to the member's inbox\nSPONSORED_VIDEO - Sponsored videos.\nSPONSORED_UPDATE_CAROUSEL - Sponsored Carousels\nFOLLOW_COMPANY_V2 - Dynamic Follow Ad\nSPOTLIGHT_V2 - Dynamic Spotlight Ad\nJOBS_V2 - Dynamic Job Ad\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_status": {"name": "creative_status", "description": "ACTIVE - Creative creation is complete and creative is available for review and serve.\nPAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation.\nDRAFT - Creative creation is incomplete and may still be edited.\nARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI.\nCANCELED - Creative is permanently canceled.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "call_to_action_label_type": {"name": "call_to_action_label_type", "description": "The labeled call-to-action on this ad.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_status": {"name": "campaign_group_status", "description": "Status of campaign's campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_status": {"name": "campaign_status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__creative_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1673278137.0744529, "compiled_code": "\n\nwith creative as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n creative.type,\n creative.click_uri,\n creative.status as creative_status,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n creative.call_to_action_label_type,\n account.currency,\n creative.last_modified_at,\n creative.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\""}, "model.linkedin.linkedin_ads__campaign_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__campaign_report"], "unique_id": "model.linkedin.linkedin_ads__campaign_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith campaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_campaign') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign.version_tag,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n campaign.type,\n campaign.cost_type,\n campaign.creative_selection,\n campaign.daily_budget_amount,\n campaign.daily_budget_currency_code,\n campaign.unit_cost_amount,\n campaign.unit_cost_currency_code,\n account.currency,\n campaign.format,\n campaign.locale_country,\n campaign.locale_language,\n campaign.objective_type,\n campaign.optimization_target_type,\n campaign.is_audience_expansion_enabled,\n campaign.is_offsite_delivery_enabled,\n campaign.run_schedule_start_at,\n campaign.run_schedule_end_at,\n campaign.last_modified_at,\n campaign.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__campaign_passthrough_metrics', transform='sum') }}\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=29) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__campaign_report.sql", "original_file_path": "models/linkedin_ads__campaign_report.sql", "name": "linkedin_ads__campaign_report", "alias": "linkedin_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "1c31aeced5e5a136b419b285d15509067f2556a279da032a1002b4a3fa18879c"}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the campaign level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_status": {"name": "campaign_group_status", "description": "Status of campaign's campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_audience_expansion_enabled": {"name": "is_audience_expansion_enabled", "description": "Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_type": {"name": "cost_type", "description": "CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000.\nCPC- Cost per individual click on the associated link.\nCPV- Cost per view for video ads.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_selection": {"name": "creative_selection", "description": "ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible.\nOPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_amount": {"name": "daily_budget_amount", "description": "Maximum amount to spend per day UTC. The amount of money as a real number string.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_currency_code": {"name": "daily_budget_currency_code", "description": "ISO currency code. The currency must match that of the parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "format": {"name": "format", "description": "The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_country": {"name": "locale_country", "description": "Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_language": {"name": "locale_language", "description": "Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_offsite_delivery_enabled": {"name": "is_offsite_delivery_enabled", "description": "Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites.\t(default will be \"True\" from June 30, 2022)\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "optimization_target_type": {"name": "optimization_target_type", "description": "Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start_at": {"name": "run_schedule_start_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end_at": {"name": "run_schedule_end_at", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_status": {"name": "campaign_status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn.\nSPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed.\nSPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox.\nDYNAMIC - Ads that are dynamically personalized.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_amount": {"name": "unit_cost_amount", "description": "This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_currency_code": {"name": "unit_cost_currency_code", "description": "Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__campaign_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1673278137.06844, "compiled_code": "\n\nwith campaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n),\n\nfinal as (\n\n select \n report.date_day,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign.version_tag,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n campaign.status as campaign_status,\n campaign_group.status as campaign_group_status,\n campaign.type,\n campaign.cost_type,\n campaign.creative_selection,\n campaign.daily_budget_amount,\n campaign.daily_budget_currency_code,\n campaign.unit_cost_amount,\n campaign.unit_cost_currency_code,\n account.currency,\n campaign.format,\n campaign.locale_country,\n campaign.locale_language,\n campaign.objective_type,\n campaign.optimization_target_type,\n campaign.is_audience_expansion_enabled,\n campaign.is_offsite_delivery_enabled,\n campaign.run_schedule_start_at,\n campaign.run_schedule_end_at,\n campaign.last_modified_at,\n campaign.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\""}, "model.linkedin.linkedin_ads__account_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__account_report"], "unique_id": "model.linkedin.linkedin_ads__account_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith account as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_campaign') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n account.account_id,\n account.account_name,\n account.version_tag,\n account.currency,\n account.status,\n account.type,\n account.last_modified_at,\n account.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__campaign_passthrough_metrics', transform='sum') }}\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join account \n on campaign.account_id = account.account_id\n\n {{ dbt_utils.group_by(n=9) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__account_report.sql", "original_file_path": "models/linkedin_ads__account_report.sql", "name": "linkedin_ads__account_report", "alias": "linkedin_ads__account_report", "checksum": {"name": "sha256", "checksum": "081d8687fbed2359f5893891308f9b3a0f25a7982a8b206f416f1a60d5c1aa6f"}, "tags": [], "refs": [["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp of when the account was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Account is active; this is the default state\nCANCELLED - Account has been permanently cancelled\nDRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving\nPENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending\nREMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "BUSINESS - This is the only value allowed when creating accounts through the API.\nENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__account_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1673278137.062737, "compiled_code": "\n\nwith account as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n),\n\nfinal as (\n\n select \n report.date_day,\n account.account_id,\n account.account_name,\n account.version_tag,\n account.currency,\n account.status,\n account.type,\n account.last_modified_at,\n account.created_at,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join campaign \n on report.campaign_id = campaign.campaign_id\n left join account \n on campaign.account_id = account.account_id\n\n group by 1,2,3,4,5,6,7,8,9\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\""}, "model.linkedin.linkedin_ads__url_report": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "linkedin_ads", "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": "linkedin_integration_tests_2_linkedin_ads", "fqn": ["linkedin", "linkedin_ads__url_report"], "unique_id": "model.linkedin.linkedin_ads__url_report", "raw_code": "{{ config(enabled=var('ad_reporting__linkedin_ads_enabled', True)) }}\n\nwith creative as (\n\n select *\n from {{ var('creative_history') }}\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from {{ var('campaign_history') }}\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from {{ var('campaign_group_history') }}\n where is_latest_version\n),\n\naccount as (\n\n select *\n from {{ var('account_history') }}\n where is_latest_version\n),\n\nreport as (\n\n select *\n from {{ var('ad_analytics_by_creative') }}\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.click_uri,\n creative.base_url,\n creative.url_host,\n creative.url_path,\n creative.utm_source,\n creative.utm_medium,\n creative.utm_campaign,\n creative.utm_content,\n creative.utm_term,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n account.currency,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n {{ fivetran_utils.persist_pass_through_columns('linkedin_ads__creative_passthrough_metrics', transform='sum') }}\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n where creative.click_uri is not null\n {% endif %}\n\n {{ dbt_utils.group_by(n=19) }}\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "linkedin_ads__url_report.sql", "original_file_path": "models/linkedin_ads__url_report.sql", "name": "linkedin_ads__url_report", "alias": "linkedin_ads__url_report", "checksum": {"name": "sha256", "checksum": "f27d55e979f8fb3ef7e216f896b7ae0875426ffa511baa0d19606b3ddc54737f"}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"], ["stg_linkedin_ads__campaign_history"], ["stg_linkedin_ads__campaign_group_history"], ["stg_linkedin_ads__account_history"], ["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "Each record in this table represents the daily performance of ads at the url level.", "columns": {"account_name": {"name": "account_name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost": {"name": "cost", "description": "The cost of the ads in the local currency or USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_name": {"name": "campaign_group_name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_id": {"name": "creative_id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `click_uri`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "A label for the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Unique internal ID representing the creative's campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "linkedin://models/linkedin.yml", "compiled_path": "target/compiled/linkedin/models/linkedin_ads__url_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "linkedin_ads", "enabled": true}, "created_at": 1673278137.0782669, "compiled_code": "\n\nwith creative as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\n where is_latest_version\n),\n\ncampaign as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n where is_latest_version\n),\n\ncampaign_group as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n where is_latest_version\n),\n\naccount as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n where is_latest_version\n),\n\nreport as (\n\n select *\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\n),\n\nfinal as (\n\n select \n report.date_day,\n creative.click_uri,\n creative.base_url,\n creative.url_host,\n creative.url_path,\n creative.utm_source,\n creative.utm_medium,\n creative.utm_campaign,\n creative.utm_content,\n creative.utm_term,\n creative.creative_id,\n creative.version_tag,\n campaign.campaign_id,\n campaign.campaign_name,\n campaign_group.campaign_group_id,\n campaign_group.campaign_group_name,\n account.account_id,\n account.account_name,\n account.currency,\n sum(report.clicks) as clicks,\n sum(report.impressions) as impressions,\n sum(report.cost) as cost\n\n \n\n\n\n\n \n from report \n left join creative \n on report.creative_id = creative.creative_id\n left join campaign \n on creative.campaign_id = campaign.campaign_id\n left join campaign_group\n on campaign.campaign_group_id = campaign_group.campaign_group_id\n left join account \n on campaign.account_id = account.account_id\n\n \n where creative.click_uri is not null\n \n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\""}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_creative')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.0019011, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_creative"}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_creative')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.0031118, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_creative"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "creative_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_creative')) }}"}, "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id", "alias": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_creative"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_aafc2af91b093fc4d5ae0ca1f56acbf9"}, "created_at": 1673278137.004256, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, creative_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_creative\"\n group by date_day, creative_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_linkedin_ads__ad_analytics_by_creative"}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_campaign')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.011818, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_campaign"}, "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_campaign')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day", "alias": "not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.012798, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.stg_linkedin_ads__ad_analytics_by_campaign"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "campaign_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__ad_analytics_by_campaign')) }}"}, "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.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id", "alias": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__ad_analytics_by_campaign"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_8315cf2be67da0ba2aede716f1af891c"}, "created_at": 1673278137.0139232, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, campaign_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__ad_analytics_by_campaign\"\n group by date_day, campaign_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_linkedin_ads__ad_analytics_by_campaign"}, "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__creative_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__creative_history_creative_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__creative_history_creative_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__creative_history_creative_id", "alias": "not_null_stg_linkedin_ads__creative_history_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__creative_history_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.017077, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.stg_linkedin_ads__creative_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_tag", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__creative_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__creative_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__creative_history_version_tag"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__creative_history_version_tag.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__creative_history_version_tag", "alias": "not_null_stg_linkedin_ads__creative_history_version_tag", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__creative_history_version_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.0182579, "compiled_code": "\n \n \n\n\n\nselect version_tag\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\nwhere version_tag is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "version_tag", "file_key_name": "models.stg_linkedin_ads__creative_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["version_tag", "creative_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__creative_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.linkedin_source.stg_linkedin_ads__creative_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id", "alias": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__creative_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_18d13dd053dd23e38fcb9beaa3ca81bc"}, "created_at": 1673278137.0192971, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n version_tag, creative_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__creative_history\"\n group by version_tag, creative_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_linkedin_ads__creative_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_history_campaign_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_history_campaign_id", "alias": "not_null_stg_linkedin_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__campaign_history_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.0226161, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.stg_linkedin_ads__campaign_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_tag", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_history_version_tag"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__campaign_history_version_tag.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_history_version_tag", "alias": "not_null_stg_linkedin_ads__campaign_history_version_tag", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__campaign_history_version_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.023796, "compiled_code": "\n \n \n\n\n\nselect version_tag\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\nwhere version_tag is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "version_tag", "file_key_name": "models.stg_linkedin_ads__campaign_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["version_tag", "campaign_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_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.linkedin_source.stg_linkedin_ads__campaign_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id", "alias": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_04241a97ca756b5a2103a7a728e18361"}, "created_at": 1673278137.024801, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n version_tag, campaign_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_history\"\n group by version_tag, campaign_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_linkedin_ads__campaign_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_group_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_group_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"]}, "config": {"enabled": true, "alias": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id", "alias": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_linkedin_ads__cam_ff659fc451955e2142e65b7eefd44f9a"}, "created_at": 1673278137.0281248, "compiled_code": "\n \n \n\n\n\nselect campaign_group_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\nwhere campaign_group_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_group_id", "file_key_name": "models.stg_linkedin_ads__campaign_group_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_modified_at", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_group_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"]}, "config": {"enabled": true, "alias": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__campaign_group_history_last_modified_at"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__campaign_group_history_last_modified_at", "alias": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_linkedin_ads__cam_2e7858c2b570943ef2af34e42f5302bd"}, "created_at": 1673278137.029214, "compiled_code": "\n \n \n\n\n\nselect last_modified_at\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\nwhere last_modified_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "last_modified_at", "file_key_name": "models.stg_linkedin_ads__campaign_group_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["last_modified_at", "campaign_group_id"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__campaign_group_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.linkedin_source.stg_linkedin_ads__campaign_group_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id", "alias": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__campaign_group_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_03fa025e903c1ddc393db8f138302b14"}, "created_at": 1673278137.030483, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n last_modified_at, campaign_group_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__campaign_group_history\"\n group by last_modified_at, campaign_group_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_linkedin_ads__campaign_group_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__account_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__account_history_account_id"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__account_history_account_id.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__account_history_account_id", "alias": "not_null_stg_linkedin_ads__account_history_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__account_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__account_history_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.033561, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id", "file_key_name": "models.stg_linkedin_ads__account_history"}, "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_tag", "model": "{{ get_where_subquery(ref('stg_linkedin_ads__account_history')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin_source.stg_linkedin_ads__account_history"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "not_null_stg_linkedin_ads__account_history_version_tag"], "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "not_null_stg_linkedin_ads__account_history_version_tag.sql", "original_file_path": "models/stg_linkedin.yml", "name": "not_null_stg_linkedin_ads__account_history_version_tag", "alias": "not_null_stg_linkedin_ads__account_history_version_tag", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__account_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/not_null_stg_linkedin_ads__account_history_version_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.034522, "compiled_code": "\n \n \n\n\n\nselect version_tag\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\nwhere version_tag is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "version_tag", "file_key_name": "models.stg_linkedin_ads__account_history"}, "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["account_id", "version_tag"], "model": "{{ get_where_subquery(ref('stg_linkedin_ads__account_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.linkedin_source.stg_linkedin_ads__account_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin_source", "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag"], "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55\") }}", "language": "sql", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55.sql", "original_file_path": "models/stg_linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag", "alias": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_linkedin_ads__account_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin_source/models/stg_linkedin.yml/dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e080bf5d4722552a352202d7efd9af55"}, "created_at": 1673278137.035724, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n account_id, version_tag\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads_source\".\"stg_linkedin_ads__account_history\"\n group by account_id, version_tag\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_linkedin_ads__account_history"}, "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('linkedin_ads__account_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__account_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__account_report_account_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__account_report_account_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__account_report_account_id", "alias": "not_null_linkedin_ads__account_report_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__account_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__account_report_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.078806, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\"\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id", "file_key_name": "models.linkedin_ads__account_report"}, "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__account_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__account_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__account_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__account_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__account_report_date_day", "alias": "not_null_linkedin_ads__account_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__account_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__account_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.0801852, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__account_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__account_report')) }}"}, "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.linkedin.linkedin_ads__account_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id", "alias": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__account_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0644abec3559f9c0247b709331bb1231"}, "created_at": 1673278137.0815449, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__account_report\"\n group by date_day, account_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.linkedin_ads__account_report"}, "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_report_date_day", "alias": "not_null_linkedin_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.084348, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__campaign_report"}, "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_report_campaign_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_report_campaign_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_report_campaign_id", "alias": "not_null_linkedin_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_report_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.08555, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.linkedin_ads__campaign_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "campaign_id", "account_id", "campaign_group_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_report')) }}"}, "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.linkedin.linkedin_ads__campaign_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id", "alias": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fd56be6c8a6c070551363fa2fd8d2873"}, "created_at": 1673278137.086802, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, campaign_id, account_id, campaign_group_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_report\"\n group by date_day, campaign_id, account_id, campaign_group_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.linkedin_ads__campaign_report"}, "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_group_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_group_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_group_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_group_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_group_report_date_day", "alias": "not_null_linkedin_ads__campaign_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_group_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_group_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.090455, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__campaign_group_report"}, "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_group_id", "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_group_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__campaign_group_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__campaign_group_report_campaign_group_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__campaign_group_report_campaign_group_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__campaign_group_report_campaign_group_id", "alias": "not_null_linkedin_ads__campaign_group_report_campaign_group_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_group_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__campaign_group_report_campaign_group_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.091438, "compiled_code": "\n \n \n\n\n\nselect campaign_group_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\"\nwhere campaign_group_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_group_id", "file_key_name": "models.linkedin_ads__campaign_group_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "campaign_group_id", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__campaign_group_report')) }}"}, "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.linkedin.linkedin_ads__campaign_group_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id", "alias": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__campaign_group_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_bcb471c45c713cd1ea59bd0229ed3f9e"}, "created_at": 1673278137.092397, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, campaign_group_id, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__campaign_group_report\"\n group by date_day, campaign_group_id, account_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.linkedin_ads__campaign_group_report"}, "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__creative_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__creative_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__creative_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__creative_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__creative_report_date_day", "alias": "not_null_linkedin_ads__creative_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__creative_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__creative_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.09527, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__creative_report"}, "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('linkedin_ads__creative_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__creative_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__creative_report_creative_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__creative_report_creative_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__creative_report_creative_id", "alias": "not_null_linkedin_ads__creative_report_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__creative_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__creative_report_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.096846, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.linkedin_ads__creative_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "creative_id", "campaign_id", "campaign_group_id", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__creative_report')) }}"}, "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.linkedin.linkedin_ads__creative_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id", "alias": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__creative_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_28cc8f6d273bc5b366ed325805452f92"}, "created_at": 1673278137.098005, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, creative_id, campaign_id, campaign_group_id, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__creative_report\"\n group by date_day, creative_id, campaign_id, campaign_group_id, account_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.linkedin_ads__creative_report"}, "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__url_report_date_day"], "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__url_report_date_day.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__url_report_date_day", "alias": "not_null_linkedin_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__url_report_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.101671, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.linkedin_ads__url_report"}, "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "creative_id", "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__url_report_creative_id"], "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__url_report_creative_id.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__url_report_creative_id", "alias": "not_null_linkedin_ads__url_report_creative_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__url_report_creative_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1673278137.102701, "compiled_code": "\n \n \n\n\n\nselect creative_id\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\nwhere creative_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "creative_id", "file_key_name": "models.linkedin_ads__url_report"}, "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "click_uri", "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "not_null_linkedin_ads__url_report_click_uri"], "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "not_null_linkedin_ads__url_report_click_uri.sql", "original_file_path": "models/linkedin.yml", "name": "not_null_linkedin_ads__url_report_click_uri", "alias": "not_null_linkedin_ads__url_report_click_uri", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/not_null_linkedin_ads__url_report_click_uri.sql", "build_path": null, "deferred": false, "unrendered_config": {"enabled": true}, "created_at": 1673278137.104196, "compiled_code": "\n \n \n\n\n\nselect click_uri\nfrom \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\nwhere click_uri is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "click_uri", "file_key_name": "models.linkedin_ads__url_report"}, "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "creative_id", "campaign_id", "campaign_group_id", "account_id"], "model": "{{ get_where_subquery(ref('linkedin_ads__url_report')) }}"}, "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.linkedin.linkedin_ads__url_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f", "schema": "dbt_test__audit", "database": 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": "linkedin_integration_tests_2_dbt_test__audit", "fqn": ["linkedin", "dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id"], "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f\") }}", "language": "sql", "package_name": "linkedin", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin", "path": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f.sql", "original_file_path": "models/linkedin.yml", "name": "dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id", "alias": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["linkedin_ads__url_report"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/linkedin/models/linkedin.yml/dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f.sql", "build_path": null, "deferred": false, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_24d7d196c7f59231b7de190c11b33a2f"}, "created_at": 1673278137.106209, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, creative_id, campaign_id, campaign_group_id, account_id\n from \"postgres\".\"linkedin_integration_tests_2_linkedin_ads\".\"linkedin_ads__url_report\"\n group by date_day, creative_id, campaign_id, campaign_group_id, account_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.linkedin_ads__url_report"}}, "sources": {"source.linkedin_source.linkedin.ad_analytics_by_creative": {"fqn": ["linkedin_source", "linkedin", "ad_analytics_by_creative"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.ad_analytics_by_creative", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "ad_analytics_by_creative", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "ad_analytics_by_creative", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record in this table represents the daily performance of ads at the creative level.", "columns": {"creative_id": {"name": "creative_id", "description": "The ID of the related creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "day": {"name": "day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_local_currency": {"name": "cost_in_local_currency", "description": "The cost of the ads in the local currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_usd": {"name": "cost_in_usd", "description": "The cost of the ads in the USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"ad_analytics_by_creative\"", "created_at": 1673278137.109757}, "source.linkedin_source.linkedin.creative_history": {"fqn": ["linkedin_source", "linkedin", "creative_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.creative_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "creative_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "creative_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of a creative.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the creative was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign the creative belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Creative creation is complete and creative is available for review and serve.\nPAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation.\nDRAFT - Creative creation is incomplete and may still be edited.\nARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI.\nCANCELED - Creative is permanently canceled.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the creative.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text with Sponsored Link to landing page on your site.\nSPONSORED_STATUS_UPDATE - Sponsored status update from a profile page.\nSPONSORED_INMAILS - Single message ad delivered to the member's inbox\nSPONSORED_MESSAGE - Conversation ad containing a tree of pre-determined messages delivered to the member's inbox\nSPONSORED_VIDEO - Sponsored videos.\nSPONSORED_UPDATE_CAROUSEL - Sponsored Carousels\nFOLLOW_COMPANY_V2 - Dynamic Follow Ad\nSPOTLIGHT_V2 - Dynamic Spotlight Ad\nJOBS_V2 - Dynamic Job Ad\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "click_uri": {"name": "click_uri", "description": "Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. \nLimit does not include the \"https://\" prefix.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "call_to_action_label_type": {"name": "call_to_action_label_type", "description": "The labeled call-to-action on this ad.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"creative_history\"", "created_at": 1673278137.109868}, "source.linkedin_source.linkedin.campaign_history": {"fqn": ["linkedin_source", "linkedin", "campaign_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.campaign_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "campaign_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of a campaign.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_group_id": {"name": "campaign_group_id", "description": "The ID of the campaign group the campaign belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "A label for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "audience_expansion_enabled": {"name": "audience_expansion_enabled", "description": "Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_type": {"name": "cost_type", "description": "CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000.\nCPC- Cost per individual click on the associated link.\nCPV- Cost per view for video ads.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creative_selection": {"name": "creative_selection", "description": "ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible.\nOPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_amount": {"name": "daily_budget_amount", "description": "Maximum amount to spend per day UTC. The amount of money as a real number string.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "daily_budget_currency_code": {"name": "daily_budget_currency_code", "description": "ISO currency code. The currency must match that of the parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "format": {"name": "format", "description": "The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_country": {"name": "locale_country", "description": "Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locale_language": {"name": "locale_language", "description": "Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offsite_delivery_enabled": {"name": "offsite_delivery_enabled", "description": "Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites.\t(default will be \"True\" from June 30, 2022)\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "optimization_target_type": {"name": "optimization_target_type", "description": "Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start": {"name": "run_schedule_start", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end": {"name": "run_schedule_end", "description": "Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Denotes that the campaign is fully servable.\nPAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be.\nARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived.\nCOMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit.\nCANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed.\nDRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated.\nPENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending.\nREMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn.\nSPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed.\nSPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox.\nDYNAMIC - Ads that are dynamically personalized.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_amount": {"name": "unit_cost_amount", "description": "This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unit_cost_currency_code": {"name": "unit_cost_currency_code", "description": "Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"campaign_history\"", "created_at": 1673278137.109972}, "source.linkedin_source.linkedin.campaign_group_history": {"fqn": ["linkedin_source", "linkedin", "campaign_group_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.campaign_group_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "campaign_group_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "campaign_group_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of a campaign group.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The ID of the account the campaign group belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the campaign group was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "A label for the campaign group.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "backfilled": {"name": "backfilled", "description": "Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_start": {"name": "run_schedule_start", "description": "Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "run_schedule_end": {"name": "run_schedule_end", "description": "Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"campaign_group_history\"", "created_at": 1673278137.1100538}, "source.linkedin_source.linkedin.account_history": {"fqn": ["linkedin_source", "linkedin", "account_history"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.account_history", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "account_history", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "account_history", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a 'version' of an account.", "columns": {"id": {"name": "id", "description": "Unique internal ID representing the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_time": {"name": "last_modified_time", "description": "The timestamp of when the version was updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_time": {"name": "created_time", "description": "The timestamp of when the account was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "A label for the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "version_tag": {"name": "version_tag", "description": "An integer representation of the version of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_campaign_optimization": {"name": "notified_on_campaign_optimization", "description": "Boolean (default=false) indicating if the campaign contact is notified about campaign optimization opportunities", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_creative_approval": {"name": "notified_on_creative_approval", "description": "Boolean (default=false) indicating if the creative contact is notified when a creative has been reviewed and approved", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_creative_rejection": {"name": "notified_on_creative_rejection", "description": "Boolean (default=false) indicating if the creative contact is notified when a creative has been rejected due to content", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notified_on_end_of_campaign": {"name": "notified_on_end_of_campaign", "description": "Boolean (default=false) indicating if the campaign contact is notified when an associated campaign has been completed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "ACTIVE - Account is active; this is the default state\nCANCELLED - Account has been permanently cancelled\nDRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving\nPENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending\nREMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "BUSINESS - This is the only value allowed when creating accounts through the API.\nENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"account_history\"", "created_at": 1673278137.110139}, "source.linkedin_source.linkedin.ad_analytics_by_campaign": {"fqn": ["linkedin_source", "linkedin", "ad_analytics_by_campaign"], "database": "postgres", "schema": "linkedin_integration_tests_2", "unique_id": "source.linkedin_source.linkedin.ad_analytics_by_campaign", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "models/src_linkedin.yml", "original_file_path": "models/src_linkedin.yml", "name": "ad_analytics_by_campaign", "source_name": "linkedin", "source_description": "", "loader": "fivetran", "identifier": "ad_analytics_by_campaign", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record in this table represents the daily performance of ads at the campaign level.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the related campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "day": {"name": "day", "description": "The day of the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The count of chargeable clicks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "This is the count of \"impressions\" for Direct Ads and Sponsored Updates and \"sends\" for InMails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_local_currency": {"name": "cost_in_local_currency", "description": "The cost of the ads in the local currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cost_in_usd": {"name": "cost_in_usd", "description": "The cost of the ads in the USD.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"linkedin_integration_tests_2\".\"ad_analytics_by_campaign\"", "created_at": 1673278137.110215}}, "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": 1673278136.103296, "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": 1673278136.1035662, "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": 1673278136.1036842, "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": 1673278136.103799, "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": 1673278136.1039119, "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": 1673278136.1051881, "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": 1673278136.106006, "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": 1673278136.111557, "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": 1673278136.112159, "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": 1673278136.112592, "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": 1673278136.112948, "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": 1673278136.113625, "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": 1673278136.114064, "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": 1673278136.114242, "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": 1673278136.114588, "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": 1673278136.115049, "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": 1673278136.116072, "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": 1673278136.1163058, "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": 1673278136.1166432, "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": 1673278136.116927, "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": 1673278136.117378, "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": 1673278136.117614, "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": 1673278136.118283, "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": 1673278136.1185331, "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": 1673278136.1186619, "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": 1673278136.119288, "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": 1673278136.120099, "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": 1673278136.1204622, "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": 1673278136.1212149, "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": 1673278136.124554, "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": 1673278136.1248362, "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": 1673278136.12543, "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": 1673278136.125925, "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": 1673278136.127159, "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": 1673278136.1273549, "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": 1673278136.127498, "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": 1673278136.127637, "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": 1673278136.1277719, "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": 1673278136.1282592, "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": 1673278136.128581, "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": 1673278136.128937, "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": 1673278136.129489, "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": 1673278136.129762, "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": 1673278136.1332018, "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": 1673278136.1333811, "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": 1673278136.133609, "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": 1673278136.1343842, "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": 1673278136.134565, "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": 1673278136.134746, "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": 1673278136.136107, "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": 1673278136.1374772, "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": 1673278136.14149, "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": 1673278136.14178, "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": 1673278136.141949, "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": 1673278136.142038, "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": 1673278136.1421819, "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": 1673278136.142296, "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": 1673278136.142508, "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": 1673278136.143389, "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": 1673278136.143588, "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": 1673278136.143836, "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": 1673278136.144268, "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": 1673278136.150239, "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": 1673278136.1523468, "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": 1673278136.152891, "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": 1673278136.153204, "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": 1673278136.153662, "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": 1673278136.154038, "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": 1673278136.1556292, "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": 1673278136.156172, "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": 1673278136.156835, "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": 1673278136.157068, "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": 1673278136.157778, "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": 1673278136.162125, "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": 1673278136.1637802, "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": 1673278136.1640399, "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": 1673278136.164783, "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": 1673278136.165047, "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": 1673278136.1657019, "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": 1673278136.1664698, "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": 1673278136.167361, "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": 1673278136.1675909, "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": 1673278136.1677692, "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": 1673278136.1680388, "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": 1673278136.168223, "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": 1673278136.1684911, "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": 1673278136.168682, "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": 1673278136.168942, "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": 1673278136.1691258, "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": 1673278136.169277, "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": 1673278136.1695511, "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": 1673278136.1745238, "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": 1673278136.180107, "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": 1673278136.181385, "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": 1673278136.1825438, "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": 1673278136.183352, "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": 1673278136.1859431, "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": 1673278136.1865249, "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": 1673278136.186708, "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": 1673278136.187125, "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": 1673278136.187532, "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": 1673278136.190142, "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": 1673278136.190563, "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": 1673278136.19078, "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": 1673278136.1923368, "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": 1673278136.192776, "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": 1673278136.192944, "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": 1673278136.19313, "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": 1673278136.193384, "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": 1673278136.196605, "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": 1673278136.201382, "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": 1673278136.202326, "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": 1673278136.2025669, "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": 1673278136.2030349, "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": 1673278136.2032242, "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": 1673278136.2033548, "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": 1673278136.203496, "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": 1673278136.203607, "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": 1673278136.203767, "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": 1673278136.203885, "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": 1673278136.2043688, "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": 1673278136.204724, "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": 1673278136.206413, "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": 1673278136.206992, "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": 1673278136.2072341, "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": 1673278136.207828, "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": 1673278136.20809, "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": 1673278136.208374, "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": 1673278136.208853, "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": 1673278136.209117, "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": 1673278136.2095501, "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": 1673278136.2099268, "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": 1673278136.210523, "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": 1673278136.211276, "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": 1673278136.212887, "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": 1673278136.241575, "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": 1673278136.241966, "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": 1673278136.244172, "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": 1673278136.245455, "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": 1673278136.2462552, "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": 1673278136.2465081, "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": 1673278136.24699, "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": 1673278136.247071, "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": 1673278136.2475, "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": 1673278136.247668, "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": 1673278136.2480068, "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": 1673278136.248141, "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": 1673278136.248477, "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": 1673278136.248587, "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": 1673278136.249009, "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": 1673278136.249183, "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": 1673278136.24949, "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": 1673278136.249571, "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": 1673278136.249923, "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": 1673278136.250072, "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": 1673278136.250452, "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": 1673278136.250698, "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": 1673278136.2514172, "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": 1673278136.251851, "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": 1673278136.25232, "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": 1673278136.2524931, "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": 1673278136.252894, "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": 1673278136.253044, "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": 1673278136.253663, "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": 1673278136.2538629, "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": 1673278136.254256, "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": 1673278136.254424, "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": 1673278136.2547672, "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": 1673278136.254882, "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": 1673278136.255268, "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": 1673278136.25541, "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": 1673278136.25575, "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": 1673278136.255862, "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": 1673278136.257004, "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": 1673278136.2571661, "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": 1673278136.257449, "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": 1673278136.257607, "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": 1673278136.257775, "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": 1673278136.257934, "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": 1673278136.258102, "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": 1673278136.258291, "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": 1673278136.258455, "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": 1673278136.2586088, "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": 1673278136.258775, "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": 1673278136.2589178, "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": 1673278136.259074, "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": 1673278136.259222, "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": 1673278136.25968, "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": 1673278136.259819, "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": 1673278136.260142, "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": 1673278136.2602491, "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": 1673278136.260662, "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": 1673278136.26094, "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": 1673278136.261089, "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": 1673278136.2616792, "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": 1673278136.2618492, "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": 1673278136.2621598, "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": 1673278136.262524, "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": 1673278136.262658, "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": 1673278136.2631319, "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": 1673278136.263566, "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": 1673278136.264134, "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": 1673278136.2642932, "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": 1673278136.2649548, "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": 1673278136.265179, "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": 1673278136.2653592, "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": 1673278136.265557, "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": 1673278136.266251, "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": 1673278136.266412, "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": 1673278136.26656, "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": 1673278136.266678, "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": 1673278136.2668538, "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": 1673278136.266934, "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": 1673278136.2671082, "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": 1673278136.267282, "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": 1673278136.2678552, "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": 1673278136.2681038, "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": 1673278136.268267, "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": 1673278136.268688, "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": 1673278136.271939, "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": 1673278136.272116, "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": 1673278136.2723389, "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": 1673278136.27264, "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": 1673278136.272887, "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": 1673278136.273212, "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": 1673278136.2735329, "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": 1673278136.273834, "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": 1673278136.27404, "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": 1673278136.274221, "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": 1673278136.274436, "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": 1673278136.2747378, "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": 1673278136.27499, "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": 1673278136.2755609, "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": 1673278136.275899, "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": 1673278136.276047, "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": 1673278136.2762501, "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": 1673278136.2769, "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": 1673278136.277339, "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": 1673278136.279098, "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": 1673278136.279218, "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": 1673278136.279388, "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": 1673278136.279501, "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": 1673278136.279865, "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": 1673278136.280064, "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": 1673278136.2801678, "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": 1673278136.280405, "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": 1673278136.28061, "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": 1673278136.280842, "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": 1673278136.2810361, "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": 1673278136.281264, "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": 1673278136.2819588, "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": 1673278136.282239, "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": 1673278136.282499, "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": 1673278136.282731, "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": 1673278136.2838778, "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": 1673278136.2846951, "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": 1673278136.284872, "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": 1673278136.285074, "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": 1673278136.285239, "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": 1673278136.285502, "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": 1673278136.2859871, "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": 1673278136.287492, "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": 1673278136.287769, "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": 1673278136.287969, "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": 1673278136.288129, "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": 1673278136.288317, "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": 1673278136.288565, "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": 1673278136.288772, "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": 1673278136.289079, "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": 1673278136.289263, "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": 1673278136.289421, "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": 1673278136.2911391, "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": 1673278136.291392, "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": 1673278136.29171, "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": 1673278136.291899, "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": 1673278136.292244, "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": 1673278136.29248, "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": 1673278136.29309, "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": 1673278136.2933528, "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": 1673278136.294146, "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": 1673278136.295786, "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": 1673278136.296315, "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": 1673278136.296808, "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": 1673278136.297226, "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": 1673278136.297305, "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": 1673278136.297972, "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": 1673278136.2982001, "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": 1673278136.298486, "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": 1673278136.2987661, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.2992158, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.299825, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.300438, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.301124, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3015559, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.301895, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.303221, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.304385, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3054478, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.306603, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.307405, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3077571, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.308556, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3094, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.309929, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.310399, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3110662, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.311619, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.312331, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3128462, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3134348, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.313925, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.314633, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.315273, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3158872, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.316233, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.316701, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.317062, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.317759, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3185751, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.31953, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.320441, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.32125, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.32219, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.322798, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.323097, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.326464, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.328167, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.32864, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.32882, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3293881, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.329834, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.330113, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3305569, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.330729, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.331415, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.332472, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.333329, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3339462, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3341901, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.334561, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.335006, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.335362, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3361459, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3371048, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3380349, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.338513, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.338733, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3393338, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.340116, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3409421, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.341414, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3417442, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.343169, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.344589, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.346011, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.348072, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3485591, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.348702, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.351827, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3554251, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3559449, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.356195, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3570051, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.357217, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.357419, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.357622, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.357787, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3579571, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.358409, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.358641, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.359078, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3597949, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.360358, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.360696, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.362397, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.362775, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.363651, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.364318, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.365748, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.367499, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.368762, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.369635, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3702211, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3710709, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.372701, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.373325, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3738382, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.374122, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3748128, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3755069, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3760588, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.376708, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3771882, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3773298, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.377471, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3780532, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3789701, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.380218, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.380527, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.3811588, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.382035, "supported_languages": null}, "macro.linkedin_source.get_creative_history_columns": {"unique_id": "macro.linkedin_source.get_creative_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_creative_history_columns.sql", "original_file_path": "macros/get_creative_history_columns.sql", "name": "get_creative_history_columns", "macro_sql": "{% macro get_creative_history_columns() %}\n\n{% set columns = [\n {\"name\": \"call_to_action_label_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"click_uri\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"version_tag\", \"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", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1673278136.383383, "supported_languages": null}, "macro.linkedin_source.get_campaign_group_history_columns": {"unique_id": "macro.linkedin_source.get_campaign_group_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_campaign_group_history_columns.sql", "original_file_path": "macros/get_campaign_group_history_columns.sql", "name": "get_campaign_group_history_columns", "macro_sql": "{% macro get_campaign_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"account_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"backfilled\", \"datatype\": \"boolean\"},\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"run_schedule_end\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"run_schedule_start\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1673278136.384562, "supported_languages": null}, "macro.linkedin_source.get_ad_analytics_by_campaign_columns": {"unique_id": "macro.linkedin_source.get_ad_analytics_by_campaign_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_ad_analytics_by_campaign_columns.sql", "original_file_path": "macros/get_ad_analytics_by_campaign_columns.sql", "name": "get_ad_analytics_by_campaign_columns", "macro_sql": "{% macro get_ad_analytics_by_campaign_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_int()},\n {\"name\": \"cost_in_local_currency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"cost_in_usd\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"day\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('linkedin_ads__campaign_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1673278136.385508, "supported_languages": null}, "macro.linkedin_source.get_campaign_history_columns": {"unique_id": "macro.linkedin_source.get_campaign_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "name": "get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"account_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"audience_expansion_enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"campaign_group_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"cost_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creative_selection\", \"datatype\": dbt.type_string()},\n {\"name\": \"daily_budget_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"daily_budget_currency_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"format\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"locale_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale_language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"objective_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"offsite_delivery_enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"optimization_target_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"run_schedule_end\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"run_schedule_start\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"unit_cost_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"unit_cost_currency_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"version_tag\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1673278136.388395, "supported_languages": null}, "macro.linkedin_source.get_ad_analytics_by_creative_columns": {"unique_id": "macro.linkedin_source.get_ad_analytics_by_creative_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_ad_analytics_by_creative_columns.sql", "original_file_path": "macros/get_ad_analytics_by_creative_columns.sql", "name": "get_ad_analytics_by_creative_columns", "macro_sql": "{% macro get_ad_analytics_by_creative_columns() %}\n\n{% set columns = [\n {\"name\": \"clicks\", \"datatype\": dbt.type_int()},\n {\"name\": \"cost_in_local_currency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"cost_in_usd\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"creative_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"day\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('linkedin_ads__creative_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1673278136.38949, "supported_languages": null}, "macro.linkedin_source.get_account_history_columns": {"unique_id": "macro.linkedin_source.get_account_history_columns", "package_name": "linkedin_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/ad_reporting/linkedin/dbt_linkedin/integration_tests/dbt_packages/linkedin_source", "path": "macros/get_account_history_columns.sql", "original_file_path": "macros/get_account_history_columns.sql", "name": "get_account_history_columns", "macro_sql": "{% macro get_account_history_columns() %}\n\n{% set columns = [\n {\"name\": \"created_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"last_modified_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"version_tag\", \"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": 1673278136.3906581, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.396286, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.397075, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.398413, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.399219, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.399991, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.401692, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.40222, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4024692, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4060748, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.414599, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.415783, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.415914, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4167, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4184792, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.418862, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.41915, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4194329, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.420002, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4202182, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4205298, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.421023, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.42204, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.42222, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.422396, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.422563, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.422715, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.422883, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.424024, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.424969, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.426183, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4264529, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.426713, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.426962, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4272141, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.42749, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.427757, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.428189, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.428297, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.428405, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.428511, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.428993, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.429711, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.430707, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.431345, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4314802, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.431617, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4317539, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.432012, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.435338, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.435523, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.435693, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.435858, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.437653, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.438793, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.438955, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.439251, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.43955, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4396899, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4398222, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4399512, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.440656, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4412642, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.441928, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.442145, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.442372, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.44281, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.44414, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.451602, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4520981, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.452777, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.454656, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4559119, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.458334, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4588459, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4593349, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4598882, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.461896, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4630342, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4640498, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4651258, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.466502, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.466697, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4668648, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.467045, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.467211, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.467515, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4679701, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.46808, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.468184, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.469005, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.470745, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.47584, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.47783, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.478372, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.47849, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4785979, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.4792168, "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/ad_reporting/linkedin/dbt_linkedin/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": 1673278136.48002, "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.linkedin_integration_tests.linkedin_campaign_group_history_data": [], "seed.linkedin_integration_tests.linkedin_account_history_data": [], "seed.linkedin_integration_tests.linkedin_campaign_history_data": [], "seed.linkedin_integration_tests.linkedin_creative_history_data": [], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data": [], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data": [], "model.linkedin_source.stg_linkedin_ads__creative_history": ["model.linkedin_source.stg_linkedin_ads__creative_history_tmp", "model.linkedin_source.stg_linkedin_ads__creative_history_tmp"], "model.linkedin_source.stg_linkedin_ads__campaign_history": ["model.linkedin_source.stg_linkedin_ads__campaign_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp", "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"], "model.linkedin_source.stg_linkedin_ads__account_history": ["model.linkedin_source.stg_linkedin_ads__account_history_tmp", "model.linkedin_source.stg_linkedin_ads__account_history_tmp"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"], "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": ["seed.linkedin_integration_tests.linkedin_campaign_history_data"], "model.linkedin_source.stg_linkedin_ads__account_history_tmp": ["seed.linkedin_integration_tests.linkedin_account_history_data"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": ["seed.linkedin_integration_tests.linkedin_campaign_group_history_data"], "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": ["seed.linkedin_integration_tests.linkedin_creative_history_data"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": ["seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"], "model.linkedin.linkedin_ads__campaign_group_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin.linkedin_ads__creative_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__creative_history"], "model.linkedin.linkedin_ads__campaign_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin.linkedin_ads__account_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin.linkedin_ads__url_report": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474": ["model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227": ["model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66": ["model.linkedin_source.stg_linkedin_ads__creative_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2": ["model.linkedin_source.stg_linkedin_ads__campaign_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469": ["model.linkedin_source.stg_linkedin_ads__campaign_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793": ["model.linkedin_source.stg_linkedin_ads__campaign_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0": ["model.linkedin_source.stg_linkedin_ads__account_history"], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81": ["model.linkedin_source.stg_linkedin_ads__account_history"], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce": ["model.linkedin_source.stg_linkedin_ads__account_history"], "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842": ["model.linkedin.linkedin_ads__account_report"], "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53": ["model.linkedin.linkedin_ads__account_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c": ["model.linkedin.linkedin_ads__account_report"], "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1": ["model.linkedin.linkedin_ads__campaign_report"], "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15": ["model.linkedin.linkedin_ads__campaign_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3": ["model.linkedin.linkedin_ads__campaign_report"], "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b": ["model.linkedin.linkedin_ads__campaign_group_report"], "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf": ["model.linkedin.linkedin_ads__campaign_group_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6": ["model.linkedin.linkedin_ads__campaign_group_report"], "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020": ["model.linkedin.linkedin_ads__creative_report"], "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889": ["model.linkedin.linkedin_ads__creative_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f": ["model.linkedin.linkedin_ads__creative_report"], "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315": ["model.linkedin.linkedin_ads__url_report"], "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2": ["model.linkedin.linkedin_ads__url_report"], "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb": ["model.linkedin.linkedin_ads__url_report"], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d": ["model.linkedin.linkedin_ads__url_report"], "source.linkedin_source.linkedin.ad_analytics_by_creative": [], "source.linkedin_source.linkedin.creative_history": [], "source.linkedin_source.linkedin.campaign_history": [], "source.linkedin_source.linkedin.campaign_group_history": [], "source.linkedin_source.linkedin.account_history": [], "source.linkedin_source.linkedin.ad_analytics_by_campaign": []}, "child_map": {"seed.linkedin_integration_tests.linkedin_campaign_group_history_data": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"], "seed.linkedin_integration_tests.linkedin_account_history_data": ["model.linkedin_source.stg_linkedin_ads__account_history_tmp"], "seed.linkedin_integration_tests.linkedin_campaign_history_data": ["model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"], "seed.linkedin_integration_tests.linkedin_creative_history_data": ["model.linkedin_source.stg_linkedin_ads__creative_history_tmp"], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"], "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"], "model.linkedin_source.stg_linkedin_ads__creative_history": ["model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66", "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474", "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227"], "model.linkedin_source.stg_linkedin_ads__campaign_history": ["model.linkedin.linkedin_ads__account_report", "model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign": ["model.linkedin.linkedin_ads__account_report", "model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history": ["model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d", "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea"], "model.linkedin_source.stg_linkedin_ads__account_history": ["model.linkedin.linkedin_ads__account_report", "model.linkedin.linkedin_ads__campaign_group_report", "model.linkedin.linkedin_ads__campaign_report", "model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce", "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0", "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative": ["model.linkedin.linkedin_ads__creative_report", "model.linkedin.linkedin_ads__url_report", "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b", "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"], "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp": ["model.linkedin_source.stg_linkedin_ads__campaign_history", "model.linkedin_source.stg_linkedin_ads__campaign_history"], "model.linkedin_source.stg_linkedin_ads__account_history_tmp": ["model.linkedin_source.stg_linkedin_ads__account_history", "model.linkedin_source.stg_linkedin_ads__account_history"], "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp": ["model.linkedin_source.stg_linkedin_ads__campaign_group_history", "model.linkedin_source.stg_linkedin_ads__campaign_group_history"], "model.linkedin_source.stg_linkedin_ads__creative_history_tmp": ["model.linkedin_source.stg_linkedin_ads__creative_history", "model.linkedin_source.stg_linkedin_ads__creative_history"], "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp": ["model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign", "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"], "model.linkedin.linkedin_ads__campaign_group_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6", "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf", "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b"], "model.linkedin.linkedin_ads__creative_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f", "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889", "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020"], "model.linkedin.linkedin_ads__campaign_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3", "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15", "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1"], "model.linkedin.linkedin_ads__account_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c", "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842", "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53"], "model.linkedin.linkedin_ads__url_report": ["test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d", "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb", "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2", "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315"], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b": [], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410": [], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a": [], "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d": [], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474": [], "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d": [], "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da": [], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0": [], "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81": [], "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce": [], "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842": [], "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c": [], "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1": [], "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3": [], "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b": [], "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6": [], "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020": [], "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f": [], "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315": [], "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2": [], "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb": [], "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d": [], "source.linkedin_source.linkedin.ad_analytics_by_creative": [], "source.linkedin_source.linkedin.creative_history": [], "source.linkedin_source.linkedin.campaign_history": [], "source.linkedin_source.linkedin.campaign_group_history": [], "source.linkedin_source.linkedin.account_history": [], "source.linkedin_source.linkedin.ad_analytics_by_campaign": []}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index 2430fb9..a29c4a7 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-12-20T02:42:48.100222Z", "invocation_id": "c6defb77-4ceb-4ee2-acc8-e4157c757363", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.882677Z", "completed_at": "2022-12-20T02:42:46.886719Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.886939Z", "completed_at": "2022-12-20T02:42:46.886948Z"}], "thread_id": "Thread-1", "execution_time": 0.005161285400390625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_account_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.889167Z", "completed_at": "2022-12-20T02:42:46.897669Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.897879Z", "completed_at": "2022-12-20T02:42:46.897885Z"}], "thread_id": "Thread-3", "execution_time": 0.01231074333190918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.898868Z", "completed_at": "2022-12-20T02:42:46.900083Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.901711Z", "completed_at": "2022-12-20T02:42:46.901730Z"}], "thread_id": "Thread-3", "execution_time": 0.004106998443603516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_creative_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.893458Z", "completed_at": "2022-12-20T02:42:46.894798Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.894954Z", "completed_at": "2022-12-20T02:42:46.894961Z"}], "thread_id": "Thread-1", "execution_time": 0.002444028854370117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.911397Z", "completed_at": "2022-12-20T02:42:46.918402Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.918631Z", "completed_at": "2022-12-20T02:42:46.918639Z"}], "thread_id": "Thread-4", "execution_time": 0.008222103118896484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_group_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.907286Z", "completed_at": "2022-12-20T02:42:46.915505Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.931342Z", "completed_at": "2022-12-20T02:42:46.931351Z"}], "thread_id": "Thread-3", "execution_time": 0.02694225311279297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.886375Z", "completed_at": "2022-12-20T02:42:46.936014Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.936262Z", "completed_at": "2022-12-20T02:42:46.936270Z"}], "thread_id": "Thread-2", "execution_time": 0.05319619178771973, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.943389Z", "completed_at": "2022-12-20T02:42:46.949599Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.950151Z", "completed_at": "2022-12-20T02:42:46.950163Z"}], "thread_id": "Thread-1", "execution_time": 0.008471965789794922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.937103Z", "completed_at": "2022-12-20T02:42:46.948248Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.948534Z", "completed_at": "2022-12-20T02:42:46.948542Z"}], "thread_id": "Thread-2", "execution_time": 0.012061119079589844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.932293Z", "completed_at": "2022-12-20T02:42:46.941455Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.951198Z", "completed_at": "2022-12-20T02:42:46.951204Z"}], "thread_id": "Thread-3", "execution_time": 0.019533157348632812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.957344Z", "completed_at": "2022-12-20T02:42:46.960614Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.960807Z", "completed_at": "2022-12-20T02:42:46.960815Z"}], "thread_id": "Thread-4", "execution_time": 0.00468897819519043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.961653Z", "completed_at": "2022-12-20T02:42:46.965375Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:46.965551Z", "completed_at": "2022-12-20T02:42:46.965559Z"}], "thread_id": "Thread-4", "execution_time": 0.004471778869628906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.981678Z", "completed_at": "2022-12-20T02:42:47.261351Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.261532Z", "completed_at": "2022-12-20T02:42:47.261540Z"}], "thread_id": "Thread-2", "execution_time": 0.30687618255615234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.966344Z", "completed_at": "2022-12-20T02:42:47.405978Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.406589Z", "completed_at": "2022-12-20T02:42:47.406595Z"}], "thread_id": "Thread-4", "execution_time": 0.46632814407348633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.990782Z", "completed_at": "2022-12-20T02:42:47.405767Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.406177Z", "completed_at": "2022-12-20T02:42:47.406187Z"}], "thread_id": "Thread-3", "execution_time": 0.4434475898742676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.439865Z", "completed_at": "2022-12-20T02:42:47.450101Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.450388Z", "completed_at": "2022-12-20T02:42:47.450396Z"}], "thread_id": "Thread-3", "execution_time": 0.011511802673339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.451515Z", "completed_at": "2022-12-20T02:42:47.457051Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.457239Z", "completed_at": "2022-12-20T02:42:47.457246Z"}], "thread_id": "Thread-3", "execution_time": 0.006361961364746094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.458128Z", "completed_at": "2022-12-20T02:42:47.460970Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.461141Z", "completed_at": "2022-12-20T02:42:47.461147Z"}], "thread_id": "Thread-3", "execution_time": 0.0035660266876220703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.461955Z", "completed_at": "2022-12-20T02:42:47.465354Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.465524Z", "completed_at": "2022-12-20T02:42:47.465530Z"}], "thread_id": "Thread-3", "execution_time": 0.004105806350708008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.466381Z", "completed_at": "2022-12-20T02:42:47.482009Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.482370Z", "completed_at": "2022-12-20T02:42:47.482381Z"}], "thread_id": "Thread-3", "execution_time": 0.016704082489013672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.483830Z", "completed_at": "2022-12-20T02:42:47.487737Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.487921Z", "completed_at": "2022-12-20T02:42:47.487929Z"}], "thread_id": "Thread-3", "execution_time": 0.004945993423461914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.488809Z", "completed_at": "2022-12-20T02:42:47.492377Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.492569Z", "completed_at": "2022-12-20T02:42:47.492575Z"}], "thread_id": "Thread-3", "execution_time": 0.0043430328369140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.493468Z", "completed_at": "2022-12-20T02:42:47.496531Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.496717Z", "completed_at": "2022-12-20T02:42:47.496724Z"}], "thread_id": "Thread-3", "execution_time": 0.003901243209838867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.497852Z", "completed_at": "2022-12-20T02:42:47.501061Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.501268Z", "completed_at": "2022-12-20T02:42:47.501275Z"}], "thread_id": "Thread-3", "execution_time": 0.004177093505859375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:46.974602Z", "completed_at": "2022-12-20T02:42:47.483083Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.483748Z", "completed_at": "2022-12-20T02:42:47.483752Z"}], "thread_id": "Thread-1", "execution_time": 0.5391008853912354, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.514490Z", "completed_at": "2022-12-20T02:42:47.521189Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.521675Z", "completed_at": "2022-12-20T02:42:47.521684Z"}], "thread_id": "Thread-3", "execution_time": 0.008279085159301758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.514578Z", "completed_at": "2022-12-20T02:42:47.521284Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.521773Z", "completed_at": "2022-12-20T02:42:47.521776Z"}], "thread_id": "Thread-1", "execution_time": 0.008314132690429688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.523277Z", "completed_at": "2022-12-20T02:42:47.559102Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.559290Z", "completed_at": "2022-12-20T02:42:47.559296Z"}], "thread_id": "Thread-3", "execution_time": 0.03688502311706543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.288643Z", "completed_at": "2022-12-20T02:42:47.607816Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.608026Z", "completed_at": "2022-12-20T02:42:47.608034Z"}], "thread_id": "Thread-2", "execution_time": 0.3497951030731201, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.639852Z", "completed_at": "2022-12-20T02:42:47.656417Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.656717Z", "completed_at": "2022-12-20T02:42:47.656726Z"}], "thread_id": "Thread-1", "execution_time": 0.018393993377685547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__account_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.640015Z", "completed_at": "2022-12-20T02:42:47.660577Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.660769Z", "completed_at": "2022-12-20T02:42:47.660778Z"}], "thread_id": "Thread-2", "execution_time": 0.021897077560424805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.639940Z", "completed_at": "2022-12-20T02:42:47.658858Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.665635Z", "completed_at": "2022-12-20T02:42:47.665643Z"}], "thread_id": "Thread-3", "execution_time": 0.027042865753173828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.661361Z", "completed_at": "2022-12-20T02:42:47.677816Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.678010Z", "completed_at": "2022-12-20T02:42:47.678017Z"}], "thread_id": "Thread-1", "execution_time": 0.018746137619018555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.673612Z", "completed_at": "2022-12-20T02:42:47.680196Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.680419Z", "completed_at": "2022-12-20T02:42:47.680425Z"}], "thread_id": "Thread-2", "execution_time": 0.009315967559814453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.666487Z", "completed_at": "2022-12-20T02:42:47.672765Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.684906Z", "completed_at": "2022-12-20T02:42:47.684913Z"}], "thread_id": "Thread-3", "execution_time": 0.019020795822143555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.681228Z", "completed_at": "2022-12-20T02:42:47.686203Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.686381Z", "completed_at": "2022-12-20T02:42:47.686385Z"}], "thread_id": "Thread-1", "execution_time": 0.008096933364868164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.433529Z", "completed_at": "2022-12-20T02:42:47.949764Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:47.949956Z", "completed_at": "2022-12-20T02:42:47.949963Z"}], "thread_id": "Thread-4", "execution_time": 0.5469410419464111, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.981405Z", "completed_at": "2022-12-20T02:42:47.994136Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.009012Z", "completed_at": "2022-12-20T02:42:48.009019Z"}], "thread_id": "Thread-2", "execution_time": 0.02905583381652832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__campaign_group_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.989164Z", "completed_at": "2022-12-20T02:42:47.995208Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.010072Z", "completed_at": "2022-12-20T02:42:48.010079Z"}], "thread_id": "Thread-3", "execution_time": 0.029165029525756836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__campaign_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.994621Z", "completed_at": "2022-12-20T02:42:48.010164Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.011995Z", "completed_at": "2022-12-20T02:42:48.012001Z"}], "thread_id": "Thread-1", "execution_time": 0.031090974807739258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__creative_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:47.994387Z", "completed_at": "2022-12-20T02:42:48.010241Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.012170Z", "completed_at": "2022-12-20T02:42:48.012175Z"}], "thread_id": "Thread-4", "execution_time": 0.025744199752807617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__url_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.013855Z", "completed_at": "2022-12-20T02:42:48.022473Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.026122Z", "completed_at": "2022-12-20T02:42:48.026130Z"}], "thread_id": "Thread-2", "execution_time": 0.0189971923828125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.018563Z", "completed_at": "2022-12-20T02:42:48.023083Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.030770Z", "completed_at": "2022-12-20T02:42:48.030776Z"}], "thread_id": "Thread-3", "execution_time": 0.01895308494567871, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.022856Z", "completed_at": "2022-12-20T02:42:48.030573Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.032115Z", "completed_at": "2022-12-20T02:42:48.032121Z"}], "thread_id": "Thread-1", "execution_time": 0.01416015625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.023162Z", "completed_at": "2022-12-20T02:42:48.031709Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.033459Z", "completed_at": "2022-12-20T02:42:48.033465Z"}], "thread_id": "Thread-4", "execution_time": 0.015265941619873047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.033605Z", "completed_at": "2022-12-20T02:42:48.042078Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.047646Z", "completed_at": "2022-12-20T02:42:48.047661Z"}], "thread_id": "Thread-2", "execution_time": 0.016945838928222656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.038739Z", "completed_at": "2022-12-20T02:42:48.047456Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.052098Z", "completed_at": "2022-12-20T02:42:48.052107Z"}], "thread_id": "Thread-3", "execution_time": 0.019939184188842773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.042481Z", "completed_at": "2022-12-20T02:42:48.048419Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.053335Z", "completed_at": "2022-12-20T02:42:48.053339Z"}], "thread_id": "Thread-1", "execution_time": 0.015913009643554688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.047834Z", "completed_at": "2022-12-20T02:42:48.053234Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.055064Z", "completed_at": "2022-12-20T02:42:48.055073Z"}], "thread_id": "Thread-4", "execution_time": 0.013751029968261719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.055439Z", "completed_at": "2022-12-20T02:42:48.065112Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.073285Z", "completed_at": "2022-12-20T02:42:48.073294Z"}], "thread_id": "Thread-2", "execution_time": 0.020159244537353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.059701Z", "completed_at": "2022-12-20T02:42:48.070128Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.074523Z", "completed_at": "2022-12-20T02:42:48.074530Z"}], "thread_id": "Thread-3", "execution_time": 0.020454883575439453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.070383Z", "completed_at": "2022-12-20T02:42:48.074603Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.075662Z", "completed_at": "2022-12-20T02:42:48.075667Z"}], "thread_id": "Thread-4", "execution_time": 0.011703968048095703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.065209Z", "completed_at": "2022-12-20T02:42:48.075405Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.077225Z", "completed_at": "2022-12-20T02:42:48.077231Z"}], "thread_id": "Thread-1", "execution_time": 0.021219968795776367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.077713Z", "completed_at": "2022-12-20T02:42:48.088171Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.092380Z", "completed_at": "2022-12-20T02:42:48.092391Z"}], "thread_id": "Thread-2", "execution_time": 0.018146991729736328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.084001Z", "completed_at": "2022-12-20T02:42:48.088045Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.092171Z", "completed_at": "2022-12-20T02:42:48.092179Z"}], "thread_id": "Thread-4", "execution_time": 0.009331941604614258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.088416Z", "completed_at": "2022-12-20T02:42:48.093351Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.097618Z", "completed_at": "2022-12-20T02:42:48.097625Z"}], "thread_id": "Thread-3", "execution_time": 0.021327972412109375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-20T02:42:48.094140Z", "completed_at": "2022-12-20T02:42:48.098387Z"}, {"name": "execute", "started_at": "2022-12-20T02:42:48.098830Z", "completed_at": "2022-12-20T02:42:48.098834Z"}], "thread_id": "Thread-1", "execution_time": 0.010146141052246094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315"}], "elapsed_time": 3.072805166244507, "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 +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2023-01-09T15:29:08.756730Z", "invocation_id": "413e08a3-98c2-41ac-8950-bf784e480296", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.946388Z", "completed_at": "2023-01-09T15:29:07.948988Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.951203Z", "completed_at": "2023-01-09T15:29:07.951210Z"}], "thread_id": "Thread-1", "execution_time": 0.006731986999511719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_account_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.946599Z", "completed_at": "2023-01-09T15:29:07.950848Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.951419Z", "completed_at": "2023-01-09T15:29:07.951421Z"}], "thread_id": "Thread-2", "execution_time": 0.006575822830200195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_campaign_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.947813Z", "completed_at": "2023-01-09T15:29:07.950997Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.951785Z", "completed_at": "2023-01-09T15:29:07.951787Z"}], "thread_id": "Thread-3", "execution_time": 0.006521940231323242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_ad_analytics_by_creative_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.947883Z", "completed_at": "2023-01-09T15:29:07.951064Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.951858Z", "completed_at": "2023-01-09T15:29:07.951860Z"}], "thread_id": "Thread-4", "execution_time": 0.006629228591918945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_group_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.954583Z", "completed_at": "2023-01-09T15:29:07.957945Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.962768Z", "completed_at": "2023-01-09T15:29:07.962777Z"}], "thread_id": "Thread-1", "execution_time": 0.01051020622253418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_campaign_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.954786Z", "completed_at": "2023-01-09T15:29:07.962413Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.962929Z", "completed_at": "2023-01-09T15:29:07.962939Z"}], "thread_id": "Thread-2", "execution_time": 0.010022163391113281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.linkedin_integration_tests.linkedin_creative_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.956755Z", "completed_at": "2023-01-09T15:29:07.963067Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.964525Z", "completed_at": "2023-01-09T15:29:07.964530Z"}], "thread_id": "Thread-3", "execution_time": 0.011241912841796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.956853Z", "completed_at": "2023-01-09T15:29:07.963172Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.964607Z", "completed_at": "2023-01-09T15:29:07.964611Z"}], "thread_id": "Thread-4", "execution_time": 0.011306285858154297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.966256Z", "completed_at": "2023-01-09T15:29:07.974210Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.976598Z", "completed_at": "2023-01-09T15:29:07.976604Z"}], "thread_id": "Thread-2", "execution_time": 0.012112855911254883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.966179Z", "completed_at": "2023-01-09T15:29:07.974270Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.976697Z", "completed_at": "2023-01-09T15:29:07.976699Z"}], "thread_id": "Thread-1", "execution_time": 0.01264810562133789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.971271Z", "completed_at": "2023-01-09T15:29:07.976540Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.977533Z", "completed_at": "2023-01-09T15:29:07.977537Z"}], "thread_id": "Thread-3", "execution_time": 0.011835336685180664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.971385Z", "completed_at": "2023-01-09T15:29:07.976751Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:07.977938Z", "completed_at": "2023-01-09T15:29:07.977940Z"}], "thread_id": "Thread-4", "execution_time": 0.012393951416015625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.979738Z", "completed_at": "2023-01-09T15:29:08.248749Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.248926Z", "completed_at": "2023-01-09T15:29:08.248933Z"}], "thread_id": "Thread-2", "execution_time": 0.30002713203430176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__account_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.990208Z", "completed_at": "2023-01-09T15:29:08.277394Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.277915Z", "completed_at": "2023-01-09T15:29:08.277923Z"}], "thread_id": "Thread-4", "execution_time": 0.3254411220550537, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.989975Z", "completed_at": "2023-01-09T15:29:08.278049Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.279321Z", "completed_at": "2023-01-09T15:29:08.279332Z"}], "thread_id": "Thread-3", "execution_time": 0.3261377811431885, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_group_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:07.979814Z", "completed_at": "2023-01-09T15:29:08.277982Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.279228Z", "completed_at": "2023-01-09T15:29:08.279233Z"}], "thread_id": "Thread-1", "execution_time": 0.3283979892730713, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.307555Z", "completed_at": "2023-01-09T15:29:08.326435Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.326647Z", "completed_at": "2023-01-09T15:29:08.326653Z"}], "thread_id": "Thread-3", "execution_time": 0.02041006088256836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__account_history_account_id__version_tag.9a655993ce"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.320480Z", "completed_at": "2023-01-09T15:29:08.327712Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.330453Z", "completed_at": "2023-01-09T15:29:08.330458Z"}], "thread_id": "Thread-1", "execution_time": 0.023066282272338867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_account_id.a9fa7f93c0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.327632Z", "completed_at": "2023-01-09T15:29:08.330906Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.331403Z", "completed_at": "2023-01-09T15:29:08.331406Z"}], "thread_id": "Thread-3", "execution_time": 0.0044062137603759766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__account_history_version_tag.58c46c5d81"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.331475Z", "completed_at": "2023-01-09T15:29:08.335443Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.338391Z", "completed_at": "2023-01-09T15:29:08.338397Z"}], "thread_id": "Thread-1", "execution_time": 0.007666349411010742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_creative_date_day__creative_id.973a01e410"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.335390Z", "completed_at": "2023-01-09T15:29:08.338951Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.339447Z", "completed_at": "2023-01-09T15:29:08.339450Z"}], "thread_id": "Thread-3", "execution_time": 0.004709959030151367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_creative_id.062abfe14b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.339518Z", "completed_at": "2023-01-09T15:29:08.342991Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.346042Z", "completed_at": "2023-01-09T15:29:08.346048Z"}], "thread_id": "Thread-1", "execution_time": 0.007259845733642578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_creative_date_day.cb81bc4766"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.342938Z", "completed_at": "2023-01-09T15:29:08.346482Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.346969Z", "completed_at": "2023-01-09T15:29:08.346972Z"}], "thread_id": "Thread-3", "execution_time": 0.004651069641113281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_group_history_last_modified_at__campaign_group_id.e761ddb4da"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.347040Z", "completed_at": "2023-01-09T15:29:08.351060Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.353700Z", "completed_at": "2023-01-09T15:29:08.353704Z"}], "thread_id": "Thread-1", "execution_time": 0.007340192794799805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_campaign_group_id.3888f3777d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.351010Z", "completed_at": "2023-01-09T15:29:08.354157Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.354642Z", "completed_at": "2023-01-09T15:29:08.354646Z"}], "thread_id": "Thread-3", "execution_time": 0.0043027400970458984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_group_history_last_modified_at.a716e2a7ea"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.354748Z", "completed_at": "2023-01-09T15:29:08.358704Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.361192Z", "completed_at": "2023-01-09T15:29:08.361196Z"}], "thread_id": "Thread-1", "execution_time": 0.0071828365325927734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__ad_analytics_by_campaign_date_day__campaign_id.b03f3dc81d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.358651Z", "completed_at": "2023-01-09T15:29:08.361612Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.362107Z", "completed_at": "2023-01-09T15:29:08.362110Z"}], "thread_id": "Thread-3", "execution_time": 0.004055976867675781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_campaign_id.d6ae242f1a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.362183Z", "completed_at": "2023-01-09T15:29:08.365026Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.365291Z", "completed_at": "2023-01-09T15:29:08.365297Z"}], "thread_id": "Thread-1", "execution_time": 0.0038149356842041016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__ad_analytics_by_campaign_date_day.ef97bed766"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.280026Z", "completed_at": "2023-01-09T15:29:08.558437Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.558610Z", "completed_at": "2023-01-09T15:29:08.558616Z"}], "thread_id": "Thread-2", "execution_time": 0.305527925491333, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__campaign_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.586456Z", "completed_at": "2023-01-09T15:29:08.653832Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.654096Z", "completed_at": "2023-01-09T15:29:08.654102Z"}], "thread_id": "Thread-3", "execution_time": 0.06881594657897949, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__account_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.586594Z", "completed_at": "2023-01-09T15:29:08.654664Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.655550Z", "completed_at": "2023-01-09T15:29:08.655554Z"}], "thread_id": "Thread-1", "execution_time": 0.07024073600769043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__campaign_group_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.620644Z", "completed_at": "2023-01-09T15:29:08.655396Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.656369Z", "completed_at": "2023-01-09T15:29:08.656372Z"}], "thread_id": "Thread-2", "execution_time": 0.07425618171691895, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__campaign_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.655885Z", "completed_at": "2023-01-09T15:29:08.661075Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.661834Z", "completed_at": "2023-01-09T15:29:08.661838Z"}], "thread_id": "Thread-3", "execution_time": 0.010149002075195312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__campaign_history_version_tag__campaign_id.2d20780793"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.661669Z", "completed_at": "2023-01-09T15:29:08.668078Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.668764Z", "completed_at": "2023-01-09T15:29:08.668773Z"}], "thread_id": "Thread-1", "execution_time": 0.008655309677124023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_campaign_id.b026971ca2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.664614Z", "completed_at": "2023-01-09T15:29:08.668545Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.669461Z", "completed_at": "2023-01-09T15:29:08.669465Z"}], "thread_id": "Thread-2", "execution_time": 0.011590719223022461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__campaign_history_version_tag.64954cc469"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.669097Z", "completed_at": "2023-01-09T15:29:08.673723Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.676458Z", "completed_at": "2023-01-09T15:29:08.676463Z"}], "thread_id": "Thread-3", "execution_time": 0.010805130004882812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__account_report_date_day__account_id.a2dcede91c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.673797Z", "completed_at": "2023-01-09T15:29:08.679165Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.679975Z", "completed_at": "2023-01-09T15:29:08.679979Z"}], "thread_id": "Thread-1", "execution_time": 0.007275104522705078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_account_id.0c34ea1842"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.676382Z", "completed_at": "2023-01-09T15:29:08.679891Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.680540Z", "completed_at": "2023-01-09T15:29:08.680543Z"}], "thread_id": "Thread-2", "execution_time": 0.011482954025268555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__account_report_date_day.c4b33f8f53"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.307478Z", "completed_at": "2023-01-09T15:29:08.655296Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.656286Z", "completed_at": "2023-01-09T15:29:08.656290Z"}], "thread_id": "Thread-4", "execution_time": 0.38011598587036133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin_source.stg_linkedin_ads__creative_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.680471Z", "completed_at": "2023-01-09T15:29:08.685720Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.689049Z", "completed_at": "2023-01-09T15:29:08.689054Z"}], "thread_id": "Thread-3", "execution_time": 0.009953022003173828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_group_report_date_day__campaign_group_id__account_id.f60989a7a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.686049Z", "completed_at": "2023-01-09T15:29:08.689974Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.692997Z", "completed_at": "2023-01-09T15:29:08.693001Z"}], "thread_id": "Thread-1", "execution_time": 0.01155996322631836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_campaign_group_id.39b448cdaf"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.689350Z", "completed_at": "2023-01-09T15:29:08.693058Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.697241Z", "completed_at": "2023-01-09T15:29:08.697246Z"}], "thread_id": "Thread-2", "execution_time": 0.01425790786743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_group_report_date_day.2676a1f76b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.692917Z", "completed_at": "2023-01-09T15:29:08.697306Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.700573Z", "completed_at": "2023-01-09T15:29:08.700577Z"}], "thread_id": "Thread-4", "execution_time": 0.011405229568481445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__campaign_report_date_day__campaign_id__account_id__campaign_group_id.0b09b4b3f3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.696934Z", "completed_at": "2023-01-09T15:29:08.700508Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.703707Z", "completed_at": "2023-01-09T15:29:08.703712Z"}], "thread_id": "Thread-3", "execution_time": 0.011511802673339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_campaign_id.bf43964b15"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.700651Z", "completed_at": "2023-01-09T15:29:08.704507Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.710684Z", "completed_at": "2023-01-09T15:29:08.710689Z"}], "thread_id": "Thread-1", "execution_time": 0.01631903648376465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__campaign_report_date_day.8d320b88b1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.703949Z", "completed_at": "2023-01-09T15:29:08.710745Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.716622Z", "completed_at": "2023-01-09T15:29:08.716627Z"}], "thread_id": "Thread-2", "execution_time": 0.019769906997680664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__creative_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.710598Z", "completed_at": "2023-01-09T15:29:08.716533Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.720811Z", "completed_at": "2023-01-09T15:29:08.720815Z"}], "thread_id": "Thread-4", "execution_time": 0.017052173614501953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.linkedin.linkedin_ads__url_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.716224Z", "completed_at": "2023-01-09T15:29:08.720974Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.724484Z", "completed_at": "2023-01-09T15:29:08.724488Z"}], "thread_id": "Thread-3", "execution_time": 0.014713048934936523, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.dbt_utils_unique_combination_of_columns_stg_linkedin_ads__creative_history_version_tag__creative_id.cc02e6aa66"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.721135Z", "completed_at": "2023-01-09T15:29:08.725170Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.728181Z", "completed_at": "2023-01-09T15:29:08.728186Z"}], "thread_id": "Thread-1", "execution_time": 0.012190103530883789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_creative_id.4d51d55474"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.724856Z", "completed_at": "2023-01-09T15:29:08.731860Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.732687Z", "completed_at": "2023-01-09T15:29:08.732690Z"}], "thread_id": "Thread-2", "execution_time": 0.014845848083496094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin_source.not_null_stg_linkedin_ads__creative_history_version_tag.d3f8e73227"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.727841Z", "completed_at": "2023-01-09T15:29:08.732592Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.736615Z", "completed_at": "2023-01-09T15:29:08.736619Z"}], "thread_id": "Thread-4", "execution_time": 0.012470006942749023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__creative_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.5c000e925f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.732441Z", "completed_at": "2023-01-09T15:29:08.736792Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.740197Z", "completed_at": "2023-01-09T15:29:08.740202Z"}], "thread_id": "Thread-3", "execution_time": 0.012813806533813477, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_creative_id.096d93f889"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.736860Z", "completed_at": "2023-01-09T15:29:08.740861Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.745137Z", "completed_at": "2023-01-09T15:29:08.745141Z"}], "thread_id": "Thread-1", "execution_time": 0.012114763259887695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__creative_report_date_day.0c6338b020"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.740550Z", "completed_at": "2023-01-09T15:29:08.747670Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.748556Z", "completed_at": "2023-01-09T15:29:08.748560Z"}], "thread_id": "Thread-2", "execution_time": 0.014260053634643555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.dbt_utils_unique_combination_of_columns_linkedin_ads__url_report_date_day__creative_id__campaign_id__campaign_group_id__account_id.d00d4a104d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.744772Z", "completed_at": "2023-01-09T15:29:08.748361Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.751648Z", "completed_at": "2023-01-09T15:29:08.751652Z"}], "thread_id": "Thread-4", "execution_time": 0.011803150177001953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_click_uri.81534087cb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.748303Z", "completed_at": "2023-01-09T15:29:08.751882Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.755110Z", "completed_at": "2023-01-09T15:29:08.755115Z"}], "thread_id": "Thread-3", "execution_time": 0.010490179061889648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_creative_id.83967fe9d2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-01-09T15:29:08.752241Z", "completed_at": "2023-01-09T15:29:08.755588Z"}, {"name": "execute", "started_at": "2023-01-09T15:29:08.755733Z", "completed_at": "2023-01-09T15:29:08.755736Z"}], "thread_id": "Thread-1", "execution_time": 0.0048639774322509766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.linkedin.not_null_linkedin_ads__url_report_date_day.48b540f315"}], "elapsed_time": 1.6856167316436768, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/joseph.markiewicz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "target": "postgres", "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 04d1272..b86c729 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'linkedin_integration_tests' -version: '0.6.0' +version: '0.6.1' profile: 'integration_tests' config-version: 2 diff --git a/models/linkedin_ads__url_report.sql b/models/linkedin_ads__url_report.sql index 7611ef6..91ac0eb 100644 --- a/models/linkedin_ads__url_report.sql +++ b/models/linkedin_ads__url_report.sql @@ -4,6 +4,7 @@ with creative as ( select * from {{ var('creative_history') }} + where is_latest_version ), campaign as (