diff --git a/dbt_project.yml b/dbt_project.yml index fbc95c0f..d4ab1b2b 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'mailchimp' -version: '0.6.0' +version: '0.7.0' require-dbt-version: [">=1.0.0", "<2.0.0"] diff --git a/docs/catalog.json b/docs/catalog.json index 11f322ff..d9abe78a 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": "0.20.2", "generated_at": "2021-10-22T16:09:34.529553Z", "invocation_id": "0e869736-6313-46cf-8816-33e49d6a2328", "env": {}}, "nodes": {"model.mailchimp_source.stg_mailchimp__automations_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automations_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 9, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 11, "name": "trigger_settings", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 296.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp"}, "model.mailchimp_source.stg_mailchimp__automations": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automations", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_id": {"type": "STRING", "index": 1, "name": "automation_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 3, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 4, "name": "segment_text", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "started_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "created_timestamp", "comment": null}, "status": {"type": "STRING", "index": 7, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 9, "name": "trigger_settings", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 287.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automations"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "combination_id": {"type": "INT64", "index": 3, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "email_id": {"type": "STRING", "index": 5, "name": "email_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 920.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients"}, "model.mailchimp_source.stg_mailchimp__segments": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segments", "database": "bigquery", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 3, "name": "member_count", "comment": null}, "segment_name": {"type": "STRING", "index": 4, "name": "segment_name", "comment": null}, "segment_type": {"type": "STRING", "index": 5, "name": "segment_type", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "updated_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "created_timestamp", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 62.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segments"}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segment_members_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 126.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp"}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaigns_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "STRING", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "STRING", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "STRING", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "INT64", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "STRING", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "STRING", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "BOOL", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 40, "name": "winning_combination_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 318.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_activities", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "activity_id": {"type": "STRING", "index": 9, "name": "activity_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 965.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities"}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_activities_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "STRING", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 9, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 783.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_activities_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "STRING", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 10, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1719.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__lists": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__lists", "database": "bigquery", "comment": null, "owner": null}, "columns": {"list_id": {"type": "STRING", "index": 1, "name": "list_id", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 2, "name": "date_created", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 4, "name": "list_rating", "comment": null}, "beamer_address": {"type": "STRING", "index": 5, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 6, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 7, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 8, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 9, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 10, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 11, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 12, "name": "contact_zip", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 18, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 19, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 20, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 21, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 22, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 23, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 24, "name": "visibility", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 371.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__lists"}, "model.mailchimp_source.stg_mailchimp__members": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__members", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "email_address": {"type": "STRING", "index": 2, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 3, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 4, "name": "email_type", "comment": null}, "status": {"type": "STRING", "index": 5, "name": "status", "comment": null}, "list_id": {"type": "STRING", "index": 6, "name": "list_id", "comment": null}, "signup_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "signup_timestamp", "comment": null}, "opt_in_timestamp": {"type": "TIMESTAMP", "index": 8, "name": "opt_in_timestamp", "comment": null}, "last_changed_timestamp": {"type": "TIMESTAMP", "index": 9, "name": "last_changed_timestamp", "comment": null}, "country_code": {"type": "STRING", "index": 10, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 11, "name": "dstoff", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 12, "name": "gmtoff", "comment": null}, "opt_in_ip_address": {"type": "STRING", "index": 13, "name": "opt_in_ip_address", "comment": null}, "signup_ip_address": {"type": "STRING", "index": 14, "name": "signup_ip_address", "comment": null}, "language": {"type": "STRING", "index": 15, "name": "language", "comment": null}, "latitude": {"type": "FLOAT64", "index": 16, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 17, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 18, "name": "member_rating", "comment": null}, "timezone": {"type": "STRING", "index": 19, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 20, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 21, "name": "vip", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1741.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__members"}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segments_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "type": {"type": "STRING", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 9, "name": "updated_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 71.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp"}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__members_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "STRING", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "STRING", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "STRING", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "STRING", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "STRING", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "TIMESTAMP", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "FLOAT64", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "STRING", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "INT64", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "STRING", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "TIMESTAMP", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "TIMESTAMP", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "STRING", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 24, "name": "vip", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1841.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp"}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__unsubscribes_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "INT64", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 6, "name": "timestamp", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 74.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_emails_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "STRING", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "INT64", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "STRING", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "STRING", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 39, "name": "use_conversation", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__unsubscribes", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}, "unsubscribe_reason": {"type": "INT64", "index": 4, "name": "unsubscribe_reason", "comment": null}, "unsubscribe_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "unsubscribe_timestamp", "comment": null}, "unsubscribe_id": {"type": "STRING", "index": 6, "name": "unsubscribe_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 100.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes"}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_emails", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "automation_id": {"type": "STRING", "index": 2, "name": "automation_id", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "created_timestamp", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "started_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "send_timestamp", "comment": null}, "from_name": {"type": "STRING", "index": 6, "name": "from_name", "comment": null}, "reply_to": {"type": "STRING", "index": 7, "name": "reply_to", "comment": null}, "status": {"type": "STRING", "index": 8, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 9, "name": "subject_line", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 11, "name": "to_name", "comment": null}, "archive_url": {"type": "STRING", "index": 12, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 13, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 14, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 15, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "INT64", "index": 16, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 17, "name": "content_type", "comment": null}, "delay_action": {"type": "STRING", "index": 18, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 19, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 20, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 21, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 22, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 23, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 24, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 25, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 26, "name": "folder_id", "comment": null}, "google_analytics": {"type": "STRING", "index": 27, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 28, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 29, "name": "position", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 32, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 33, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 34, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 35, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 36, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 37, "name": "use_conversation", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 343.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails"}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__lists_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "STRING", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "STRING", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 26, "name": "visibility", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 380.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_recipients_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 132.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "INT64", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 660.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_activities", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 9, "name": "combination_id", "comment": null}, "activity_id": {"type": "STRING", "index": 10, "name": "activity_id", "comment": null}, "email_id": {"type": "STRING", "index": 11, "name": "email_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2739.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities"}, "model.mailchimp_source.stg_mailchimp__campaigns": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaigns", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "create_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "create_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "send_timestamp", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "reply_to_email": {"type": "STRING", "index": 6, "name": "reply_to_email", "comment": null}, "campaign_type": {"type": "STRING", "index": 7, "name": "campaign_type", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "archive_url": {"type": "STRING", "index": 9, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 10, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 11, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 12, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 13, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 14, "name": "content_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 15, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 16, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 17, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 18, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 19, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 20, "name": "inline_css", "comment": null}, "long_archive_url": {"type": "STRING", "index": 21, "name": "long_archive_url", "comment": null}, "status": {"type": "STRING", "index": 22, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 23, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 24, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 25, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 26, "name": "timewarp", "comment": null}, "to_name": {"type": "STRING", "index": 27, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 28, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 29, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 30, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 31, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 32, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "BOOL", "index": 33, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 34, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 35, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 36, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 37, "name": "winning_combination_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 309.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns"}, "model.mailchimp_source.stg_mailchimp__segment_members": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segment_members", "database": "bigquery", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 108.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members"}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_recipients", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}, "automation_recipient_id": {"type": "STRING", "index": 4, "name": "automation_recipient_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 184.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients"}, "model.mailchimp.mailchimp__campaigns": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__campaigns", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "create_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "create_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "send_timestamp", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "reply_to_email": {"type": "STRING", "index": 6, "name": "reply_to_email", "comment": null}, "campaign_type": {"type": "STRING", "index": 7, "name": "campaign_type", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "archive_url": {"type": "STRING", "index": 9, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 10, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 11, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 12, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 13, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 14, "name": "content_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 15, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 16, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 17, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 18, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 19, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 20, "name": "inline_css", "comment": null}, "long_archive_url": {"type": "STRING", "index": 21, "name": "long_archive_url", "comment": null}, "status": {"type": "STRING", "index": 22, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 23, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 24, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 25, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 26, "name": "timewarp", "comment": null}, "to_name": {"type": "STRING", "index": 27, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 28, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 29, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 30, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 31, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 32, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "BOOL", "index": 33, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 34, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 35, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 36, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 37, "name": "winning_combination_id", "comment": null}, "sends": {"type": "INT64", "index": 38, "name": "sends", "comment": null}, "opens": {"type": "INT64", "index": 39, "name": "opens", "comment": null}, "clicks": {"type": "INT64", "index": 40, "name": "clicks", "comment": null}, "unique_opens": {"type": "INT64", "index": 41, "name": "unique_opens", "comment": null}, "unique_clicks": {"type": "INT64", "index": 42, "name": "unique_clicks", "comment": null}, "unsubscribes": {"type": "INT64", "index": 43, "name": "unsubscribes", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 357.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__campaigns"}, "model.mailchimp.mailchimp__campaign_activities": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__campaign_activities", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 9, "name": "combination_id", "comment": null}, "activity_id": {"type": "STRING", "index": 10, "name": "activity_id", "comment": null}, "email_id": {"type": "STRING", "index": 11, "name": "email_id", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 12, "name": "send_timestamp", "comment": null}, "time_since_send_minutes": {"type": "INT64", "index": 13, "name": "time_since_send_minutes", "comment": null}, "time_since_send_hours": {"type": "INT64", "index": 14, "name": "time_since_send_hours", "comment": null}, "time_since_send_days": {"type": "INT64", "index": 15, "name": "time_since_send_days", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3283.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__campaign_activities"}, "model.mailchimp.mailchimp__members": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__members", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "email_address": {"type": "STRING", "index": 2, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 3, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 4, "name": "email_type", "comment": null}, "status": {"type": "STRING", "index": 5, "name": "status", "comment": null}, "list_id": {"type": "STRING", "index": 6, "name": "list_id", "comment": null}, "signup_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "signup_timestamp", "comment": null}, "opt_in_timestamp": {"type": "TIMESTAMP", "index": 8, "name": "opt_in_timestamp", "comment": null}, "last_changed_timestamp": {"type": "TIMESTAMP", "index": 9, "name": "last_changed_timestamp", "comment": null}, "country_code": {"type": "STRING", "index": 10, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 11, "name": "dstoff", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 12, "name": "gmtoff", "comment": null}, "opt_in_ip_address": {"type": "STRING", "index": 13, "name": "opt_in_ip_address", "comment": null}, "signup_ip_address": {"type": "STRING", "index": 14, "name": "signup_ip_address", "comment": null}, "language": {"type": "STRING", "index": 15, "name": "language", "comment": null}, "latitude": {"type": "FLOAT64", "index": 16, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 17, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 18, "name": "member_rating", "comment": null}, "timezone": {"type": "STRING", "index": 19, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 20, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 21, "name": "vip", "comment": null}, "campaign_sends": {"type": "INT64", "index": 22, "name": "campaign_sends", "comment": null}, "campaign_opens": {"type": "INT64", "index": 23, "name": "campaign_opens", "comment": null}, "campaign_clicks": {"type": "INT64", "index": 24, "name": "campaign_clicks", "comment": null}, "campaign_unique_opens": {"type": "INT64", "index": 25, "name": "campaign_unique_opens", "comment": null}, "campaign_unique_clicks": {"type": "INT64", "index": 26, "name": "campaign_unique_clicks", "comment": null}, "campaign_unsubscribes": {"type": "INT64", "index": 27, "name": "campaign_unsubscribes", "comment": null}, "automation_sends": {"type": "INT64", "index": 28, "name": "automation_sends", "comment": null}, "automation_opens": {"type": "INT64", "index": 29, "name": "automation_opens", "comment": null}, "automation_clicks": {"type": "INT64", "index": 30, "name": "automation_clicks", "comment": null}, "automation_unique_opens": {"type": "INT64", "index": 31, "name": "automation_unique_opens", "comment": null}, "automation_unique_clicks": {"type": "INT64", "index": 32, "name": "automation_unique_clicks", "comment": null}, "automation_unsubscribes": {"type": "INT64", "index": 33, "name": "automation_unsubscribes", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2509.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__members"}, "model.mailchimp.mailchimp__automation_emails": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__automation_emails", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "automation_id": {"type": "STRING", "index": 2, "name": "automation_id", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "created_timestamp", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "started_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "send_timestamp", "comment": null}, "from_name": {"type": "STRING", "index": 6, "name": "from_name", "comment": null}, "reply_to": {"type": "STRING", "index": 7, "name": "reply_to", "comment": null}, "status": {"type": "STRING", "index": 8, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 9, "name": "subject_line", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 11, "name": "to_name", "comment": null}, "archive_url": {"type": "STRING", "index": 12, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 13, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 14, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 15, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "INT64", "index": 16, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 17, "name": "content_type", "comment": null}, "delay_action": {"type": "STRING", "index": 18, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 19, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 20, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 21, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 22, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 23, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 24, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 25, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 26, "name": "folder_id", "comment": null}, "google_analytics": {"type": "STRING", "index": 27, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 28, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 29, "name": "position", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 32, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 33, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 34, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 35, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 36, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 37, "name": "use_conversation", "comment": null}, "list_id": {"type": "STRING", "index": 38, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 39, "name": "segment_id", "comment": null}, "sends": {"type": "INT64", "index": 40, "name": "sends", "comment": null}, "opens": {"type": "INT64", "index": 41, "name": "opens", "comment": null}, "clicks": {"type": "INT64", "index": 42, "name": "clicks", "comment": null}, "unique_opens": {"type": "INT64", "index": 43, "name": "unique_opens", "comment": null}, "unique_clicks": {"type": "INT64", "index": 44, "name": "unique_clicks", "comment": null}, "unsubscribes": {"type": "INT64", "index": 45, "name": "unsubscribes", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 403.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__automation_emails"}, "model.mailchimp.mailchimp__campaign_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__campaign_recipients", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "combination_id": {"type": "INT64", "index": 3, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "email_id": {"type": "STRING", "index": 5, "name": "email_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "send_timestamp", "comment": null}, "opens": {"type": "INT64", "index": 8, "name": "opens", "comment": null}, "unique_opens": {"type": "INT64", "index": 9, "name": "unique_opens", "comment": null}, "clicks": {"type": "INT64", "index": 10, "name": "clicks", "comment": null}, "unique_clicks": {"type": "INT64", "index": 11, "name": "unique_clicks", "comment": null}, "was_opened": {"type": "BOOL", "index": 12, "name": "was_opened", "comment": null}, "was_clicked": {"type": "BOOL", "index": 13, "name": "was_clicked", "comment": null}, "first_open_timestamp": {"type": "TIMESTAMP", "index": 14, "name": "first_open_timestamp", "comment": null}, "time_to_open_minutes": {"type": "INT64", "index": 15, "name": "time_to_open_minutes", "comment": null}, "time_to_open_hours": {"type": "INT64", "index": 16, "name": "time_to_open_hours", "comment": null}, "time_to_open_days": {"type": "INT64", "index": 17, "name": "time_to_open_days", "comment": null}, "was_unsubscribed": {"type": "BOOL", "index": 18, "name": "was_unsubscribed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1574.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__campaign_recipients"}, "model.mailchimp.mailchimp__automations": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__automations", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_id": {"type": "STRING", "index": 1, "name": "automation_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 3, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 4, "name": "segment_text", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "started_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "created_timestamp", "comment": null}, "status": {"type": "STRING", "index": 7, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 9, "name": "trigger_settings", "comment": null}, "sends": {"type": "INT64", "index": 10, "name": "sends", "comment": null}, "opens": {"type": "INT64", "index": 11, "name": "opens", "comment": null}, "clicks": {"type": "INT64", "index": 12, "name": "clicks", "comment": null}, "unique_opens": {"type": "INT64", "index": 13, "name": "unique_opens", "comment": null}, "unique_clicks": {"type": "INT64", "index": 14, "name": "unique_clicks", "comment": null}, "unsubscribes": {"type": "INT64", "index": 15, "name": "unsubscribes", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 335.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__automations"}, "model.mailchimp.mailchimp__lists": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__lists", "database": "bigquery", "comment": null, "owner": null}, "columns": {"list_id": {"type": "STRING", "index": 1, "name": "list_id", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 2, "name": "date_created", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 4, "name": "list_rating", "comment": null}, "beamer_address": {"type": "STRING", "index": 5, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 6, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 7, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 8, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 9, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 10, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 11, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 12, "name": "contact_zip", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 18, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 19, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 20, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 21, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 22, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 23, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 24, "name": "visibility", "comment": null}, "count_members": {"type": "INT64", "index": 25, "name": "count_members", "comment": null}, "most_recent_signup_timestamp": {"type": "TIMESTAMP", "index": 26, "name": "most_recent_signup_timestamp", "comment": null}, "campaign_sends": {"type": "INT64", "index": 27, "name": "campaign_sends", "comment": null}, "campaign_opens": {"type": "INT64", "index": 28, "name": "campaign_opens", "comment": null}, "campaign_clicks": {"type": "INT64", "index": 29, "name": "campaign_clicks", "comment": null}, "campaign_unique_opens": {"type": "INT64", "index": 30, "name": "campaign_unique_opens", "comment": null}, "campaign_unique_clicks": {"type": "INT64", "index": 31, "name": "campaign_unique_clicks", "comment": null}, "campaign_unsubscribes": {"type": "INT64", "index": 32, "name": "campaign_unsubscribes", "comment": null}, "automation_sends": {"type": "INT64", "index": 33, "name": "automation_sends", "comment": null}, "automation_opens": {"type": "INT64", "index": 34, "name": "automation_opens", "comment": null}, "automation_clicks": {"type": "INT64", "index": 35, "name": "automation_clicks", "comment": null}, "automation_unique_opens": {"type": "INT64", "index": 36, "name": "automation_unique_opens", "comment": null}, "automation_unique_clicks": {"type": "INT64", "index": 37, "name": "automation_unique_clicks", "comment": null}, "automation_unsubscribes": {"type": "INT64", "index": 38, "name": "automation_unsubscribes", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 483.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__lists"}, "model.mailchimp.mailchimp__segments": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__segments", "database": "bigquery", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 3, "name": "member_count", "comment": null}, "segment_name": {"type": "STRING", "index": 4, "name": "segment_name", "comment": null}, "segment_type": {"type": "STRING", "index": 5, "name": "segment_type", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "updated_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "created_timestamp", "comment": null}, "campaign_sends": {"type": "INT64", "index": 8, "name": "campaign_sends", "comment": null}, "campaign_opens": {"type": "INT64", "index": 9, "name": "campaign_opens", "comment": null}, "campaign_clicks": {"type": "INT64", "index": 10, "name": "campaign_clicks", "comment": null}, "campaign_unique_opens": {"type": "INT64", "index": 11, "name": "campaign_unique_opens", "comment": null}, "campaign_unique_clicks": {"type": "INT64", "index": 12, "name": "campaign_unique_clicks", "comment": null}, "campaign_unsubscribes": {"type": "INT64", "index": 13, "name": "campaign_unsubscribes", "comment": null}, "list_name": {"type": "STRING", "index": 14, "name": "list_name", "comment": null}, "automation_sends": {"type": "INT64", "index": 15, "name": "automation_sends", "comment": null}, "automation_opens": {"type": "INT64", "index": 16, "name": "automation_opens", "comment": null}, "automation_clicks": {"type": "INT64", "index": 17, "name": "automation_clicks", "comment": null}, "automation_unique_opens": {"type": "INT64", "index": 18, "name": "automation_unique_opens", "comment": null}, "automation_unique_clicks": {"type": "INT64", "index": 19, "name": "automation_unique_clicks", "comment": null}, "automation_unsubscribes": {"type": "INT64", "index": 20, "name": "automation_unsubscribes", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 175.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__segments"}, "model.mailchimp.mailchimp__automation_activities": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__automation_activities", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "activity_id": {"type": "STRING", "index": 9, "name": "activity_id", "comment": null}, "automation_id": {"type": "STRING", "index": 10, "name": "automation_id", "comment": null}, "segment_id": {"type": "INT64", "index": 11, "name": "segment_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1049.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__automation_activities"}}, "sources": {"source.mailchimp_source.mailchimp.automation_recipient_activity": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_recipient_activity", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "STRING", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 9, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 783.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_recipient_activity"}, "source.mailchimp_source.mailchimp.member": {"metadata": {"type": "table", "schema": "mailchimp", "name": "member", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "STRING", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "STRING", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "STRING", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "STRING", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "STRING", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "TIMESTAMP", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "FLOAT64", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "STRING", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "INT64", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "STRING", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "TIMESTAMP", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "TIMESTAMP", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "STRING", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 24, "name": "vip", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1841.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.member"}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign_recipient_activity", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "STRING", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 10, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1719.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient_activity"}, "source.mailchimp_source.mailchimp.campaign_recipient": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign_recipient", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "INT64", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 660.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient"}, "source.mailchimp_source.mailchimp.automation_email": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_email", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "STRING", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "INT64", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "STRING", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "STRING", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 39, "name": "use_conversation", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_email"}, "source.mailchimp_source.mailchimp.segment_member": {"metadata": {"type": "table", "schema": "mailchimp", "name": "segment_member", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 126.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.segment_member"}, "source.mailchimp_source.mailchimp.list": {"metadata": {"type": "table", "schema": "mailchimp", "name": "list", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "STRING", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "STRING", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 26, "name": "visibility", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 380.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.list"}, "source.mailchimp_source.mailchimp.unsubscribe": {"metadata": {"type": "table", "schema": "mailchimp", "name": "unsubscribe", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "INT64", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 6, "name": "timestamp", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 74.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.unsubscribe"}, "source.mailchimp_source.mailchimp.campaign": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "STRING", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "STRING", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "STRING", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "INT64", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "STRING", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "STRING", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "BOOL", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 40, "name": "winning_combination_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 318.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign"}, "source.mailchimp_source.mailchimp.automation_recipient": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_recipient", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 132.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_recipient"}, "source.mailchimp_source.mailchimp.segment": {"metadata": {"type": "table", "schema": "mailchimp", "name": "segment", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "type": {"type": "STRING", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 9, "name": "updated_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 71.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.segment"}, "source.mailchimp_source.mailchimp.automation": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 9, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 11, "name": "trigger_settings", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 296.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.0.0", "generated_at": "2022-01-12T20:14:17.521880Z", "invocation_id": "b34aa7dc-6b6b-4c9b-93da-d6b0325c8f1a", "env": {}}, "nodes": {"model.mailchimp.mailchimp__automation_activities": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__automation_activities", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "activity_id": {"type": "STRING", "index": 9, "name": "activity_id", "comment": null}, "automation_id": {"type": "STRING", "index": 10, "name": "automation_id", "comment": null}, "segment_id": {"type": "INT64", "index": 11, "name": "segment_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1049.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__automation_activities"}, "model.mailchimp.mailchimp__campaign_activities": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__campaign_activities", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 9, "name": "combination_id", "comment": null}, "activity_id": {"type": "STRING", "index": 10, "name": "activity_id", "comment": null}, "email_id": {"type": "STRING", "index": 11, "name": "email_id", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 12, "name": "send_timestamp", "comment": null}, "time_since_send_minutes": {"type": "INT64", "index": 13, "name": "time_since_send_minutes", "comment": null}, "time_since_send_hours": {"type": "INT64", "index": 14, "name": "time_since_send_hours", "comment": null}, "time_since_send_days": {"type": "INT64", "index": 15, "name": "time_since_send_days", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3283.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__campaign_activities"}, "model.mailchimp.mailchimp__campaigns": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__campaigns", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "create_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "create_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "send_timestamp", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "reply_to_email": {"type": "STRING", "index": 6, "name": "reply_to_email", "comment": null}, "campaign_type": {"type": "STRING", "index": 7, "name": "campaign_type", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "archive_url": {"type": "STRING", "index": 9, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 10, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 11, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 12, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 13, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 14, "name": "content_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 15, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 16, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 17, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 18, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 19, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 20, "name": "inline_css", "comment": null}, "long_archive_url": {"type": "STRING", "index": 21, "name": "long_archive_url", "comment": null}, "status": {"type": "STRING", "index": 22, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 23, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 24, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 25, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 26, "name": "timewarp", "comment": null}, "to_name": {"type": "STRING", "index": 27, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 28, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 29, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 30, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 31, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 32, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "BOOL", "index": 33, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 34, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 35, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 36, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 37, "name": "winning_combination_id", "comment": null}, "sends": {"type": "INT64", "index": 38, "name": "sends", "comment": null}, "opens": {"type": "INT64", "index": 39, "name": "opens", "comment": null}, "clicks": {"type": "INT64", "index": 40, "name": "clicks", "comment": null}, "unique_opens": {"type": "INT64", "index": 41, "name": "unique_opens", "comment": null}, "unique_clicks": {"type": "INT64", "index": 42, "name": "unique_clicks", "comment": null}, "unsubscribes": {"type": "INT64", "index": 43, "name": "unsubscribes", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 357.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__campaigns"}, "model.mailchimp.mailchimp__members": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__members", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "email_address": {"type": "STRING", "index": 2, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 3, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 4, "name": "email_type", "comment": null}, "status": {"type": "STRING", "index": 5, "name": "status", "comment": null}, "list_id": {"type": "STRING", "index": 6, "name": "list_id", "comment": null}, "signup_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "signup_timestamp", "comment": null}, "opt_in_timestamp": {"type": "TIMESTAMP", "index": 8, "name": "opt_in_timestamp", "comment": null}, "last_changed_timestamp": {"type": "TIMESTAMP", "index": 9, "name": "last_changed_timestamp", "comment": null}, "country_code": {"type": "STRING", "index": 10, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 11, "name": "dstoff", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 12, "name": "gmtoff", "comment": null}, "opt_in_ip_address": {"type": "STRING", "index": 13, "name": "opt_in_ip_address", "comment": null}, "signup_ip_address": {"type": "STRING", "index": 14, "name": "signup_ip_address", "comment": null}, "language": {"type": "STRING", "index": 15, "name": "language", "comment": null}, "latitude": {"type": "FLOAT64", "index": 16, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 17, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 18, "name": "member_rating", "comment": null}, "timezone": {"type": "STRING", "index": 19, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 20, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 21, "name": "vip", "comment": null}, "list_member_id": {"type": "STRING", "index": 22, "name": "list_member_id", "comment": null}, "campaign_sends": {"type": "INT64", "index": 23, "name": "campaign_sends", "comment": null}, "campaign_opens": {"type": "INT64", "index": 24, "name": "campaign_opens", "comment": null}, "campaign_clicks": {"type": "INT64", "index": 25, "name": "campaign_clicks", "comment": null}, "campaign_unique_opens": {"type": "INT64", "index": 26, "name": "campaign_unique_opens", "comment": null}, "campaign_unique_clicks": {"type": "INT64", "index": 27, "name": "campaign_unique_clicks", "comment": null}, "campaign_unsubscribes": {"type": "INT64", "index": 28, "name": "campaign_unsubscribes", "comment": null}, "automation_sends": {"type": "INT64", "index": 29, "name": "automation_sends", "comment": null}, "automation_opens": {"type": "INT64", "index": 30, "name": "automation_opens", "comment": null}, "automation_clicks": {"type": "INT64", "index": 31, "name": "automation_clicks", "comment": null}, "automation_unique_opens": {"type": "INT64", "index": 32, "name": "automation_unique_opens", "comment": null}, "automation_unique_clicks": {"type": "INT64", "index": 33, "name": "automation_unique_clicks", "comment": null}, "automation_unsubscribes": {"type": "INT64", "index": 34, "name": "automation_unsubscribes", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2781.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__members"}, "model.mailchimp.mailchimp__automation_emails": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__automation_emails", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "automation_id": {"type": "STRING", "index": 2, "name": "automation_id", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "created_timestamp", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "started_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "send_timestamp", "comment": null}, "from_name": {"type": "STRING", "index": 6, "name": "from_name", "comment": null}, "reply_to": {"type": "STRING", "index": 7, "name": "reply_to", "comment": null}, "status": {"type": "STRING", "index": 8, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 9, "name": "subject_line", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 11, "name": "to_name", "comment": null}, "archive_url": {"type": "STRING", "index": 12, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 13, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 14, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 15, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "INT64", "index": 16, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 17, "name": "content_type", "comment": null}, "delay_action": {"type": "STRING", "index": 18, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 19, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 20, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 21, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 22, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 23, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 24, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 25, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 26, "name": "folder_id", "comment": null}, "google_analytics": {"type": "STRING", "index": 27, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 28, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 29, "name": "position", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 32, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 33, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 34, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 35, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 36, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 37, "name": "use_conversation", "comment": null}, "list_id": {"type": "STRING", "index": 38, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 39, "name": "segment_id", "comment": null}, "sends": {"type": "INT64", "index": 40, "name": "sends", "comment": null}, "opens": {"type": "INT64", "index": 41, "name": "opens", "comment": null}, "clicks": {"type": "INT64", "index": 42, "name": "clicks", "comment": null}, "unique_opens": {"type": "INT64", "index": 43, "name": "unique_opens", "comment": null}, "unique_clicks": {"type": "INT64", "index": 44, "name": "unique_clicks", "comment": null}, "unsubscribes": {"type": "INT64", "index": 45, "name": "unsubscribes", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 403.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__automation_emails"}, "model.mailchimp.mailchimp__lists": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__lists", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"list_id": {"type": "STRING", "index": 1, "name": "list_id", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 2, "name": "date_created", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 4, "name": "list_rating", "comment": null}, "beamer_address": {"type": "STRING", "index": 5, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 6, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 7, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 8, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 9, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 10, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 11, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 12, "name": "contact_zip", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 18, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 19, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 20, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 21, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 22, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 23, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 24, "name": "visibility", "comment": null}, "count_members": {"type": "INT64", "index": 25, "name": "count_members", "comment": null}, "most_recent_signup_timestamp": {"type": "TIMESTAMP", "index": 26, "name": "most_recent_signup_timestamp", "comment": null}, "campaign_sends": {"type": "INT64", "index": 27, "name": "campaign_sends", "comment": null}, "campaign_opens": {"type": "INT64", "index": 28, "name": "campaign_opens", "comment": null}, "campaign_clicks": {"type": "INT64", "index": 29, "name": "campaign_clicks", "comment": null}, "campaign_unique_opens": {"type": "INT64", "index": 30, "name": "campaign_unique_opens", "comment": null}, "campaign_unique_clicks": {"type": "INT64", "index": 31, "name": "campaign_unique_clicks", "comment": null}, "campaign_unsubscribes": {"type": "INT64", "index": 32, "name": "campaign_unsubscribes", "comment": null}, "automation_sends": {"type": "INT64", "index": 33, "name": "automation_sends", "comment": null}, "automation_opens": {"type": "INT64", "index": 34, "name": "automation_opens", "comment": null}, "automation_clicks": {"type": "INT64", "index": 35, "name": "automation_clicks", "comment": null}, "automation_unique_opens": {"type": "INT64", "index": 36, "name": "automation_unique_opens", "comment": null}, "automation_unique_clicks": {"type": "INT64", "index": 37, "name": "automation_unique_clicks", "comment": null}, "automation_unsubscribes": {"type": "INT64", "index": 38, "name": "automation_unsubscribes", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 483.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__lists"}, "model.mailchimp.mailchimp__automations": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__automations", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"automation_id": {"type": "STRING", "index": 1, "name": "automation_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 3, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 4, "name": "segment_text", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "started_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "created_timestamp", "comment": null}, "status": {"type": "STRING", "index": 7, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 9, "name": "trigger_settings", "comment": null}, "sends": {"type": "INT64", "index": 10, "name": "sends", "comment": null}, "opens": {"type": "INT64", "index": 11, "name": "opens", "comment": null}, "clicks": {"type": "INT64", "index": 12, "name": "clicks", "comment": null}, "unique_opens": {"type": "INT64", "index": 13, "name": "unique_opens", "comment": null}, "unique_clicks": {"type": "INT64", "index": 14, "name": "unique_clicks", "comment": null}, "unsubscribes": {"type": "INT64", "index": 15, "name": "unsubscribes", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 335.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__automations"}, "model.mailchimp.mailchimp__campaign_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__campaign_recipients", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "combination_id": {"type": "INT64", "index": 3, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "email_id": {"type": "STRING", "index": 5, "name": "email_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "send_timestamp", "comment": null}, "opens": {"type": "INT64", "index": 8, "name": "opens", "comment": null}, "unique_opens": {"type": "INT64", "index": 9, "name": "unique_opens", "comment": null}, "clicks": {"type": "INT64", "index": 10, "name": "clicks", "comment": null}, "unique_clicks": {"type": "INT64", "index": 11, "name": "unique_clicks", "comment": null}, "was_opened": {"type": "BOOL", "index": 12, "name": "was_opened", "comment": null}, "was_clicked": {"type": "BOOL", "index": 13, "name": "was_clicked", "comment": null}, "first_open_timestamp": {"type": "TIMESTAMP", "index": 14, "name": "first_open_timestamp", "comment": null}, "time_to_open_minutes": {"type": "INT64", "index": 15, "name": "time_to_open_minutes", "comment": null}, "time_to_open_hours": {"type": "INT64", "index": 16, "name": "time_to_open_hours", "comment": null}, "time_to_open_days": {"type": "INT64", "index": 17, "name": "time_to_open_days", "comment": null}, "was_unsubscribed": {"type": "BOOL", "index": 18, "name": "was_unsubscribed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1574.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__campaign_recipients"}, "model.mailchimp.mailchimp__segments": {"metadata": {"type": "table", "schema": "dbt_renee_mailchimp", "name": "mailchimp__segments", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 3, "name": "member_count", "comment": null}, "segment_name": {"type": "STRING", "index": 4, "name": "segment_name", "comment": null}, "segment_type": {"type": "STRING", "index": 5, "name": "segment_type", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "updated_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "created_timestamp", "comment": null}, "campaign_sends": {"type": "INT64", "index": 8, "name": "campaign_sends", "comment": null}, "campaign_opens": {"type": "INT64", "index": 9, "name": "campaign_opens", "comment": null}, "campaign_clicks": {"type": "INT64", "index": 10, "name": "campaign_clicks", "comment": null}, "campaign_unique_opens": {"type": "INT64", "index": 11, "name": "campaign_unique_opens", "comment": null}, "campaign_unique_clicks": {"type": "INT64", "index": 12, "name": "campaign_unique_clicks", "comment": null}, "campaign_unsubscribes": {"type": "INT64", "index": 13, "name": "campaign_unsubscribes", "comment": null}, "list_name": {"type": "STRING", "index": 14, "name": "list_name", "comment": null}, "automation_sends": {"type": "INT64", "index": 15, "name": "automation_sends", "comment": null}, "automation_opens": {"type": "INT64", "index": 16, "name": "automation_opens", "comment": null}, "automation_clicks": {"type": "INT64", "index": 17, "name": "automation_clicks", "comment": null}, "automation_unique_opens": {"type": "INT64", "index": 18, "name": "automation_unique_opens", "comment": null}, "automation_unique_clicks": {"type": "INT64", "index": 19, "name": "automation_unique_clicks", "comment": null}, "automation_unsubscribes": {"type": "INT64", "index": 20, "name": "automation_unsubscribes", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 175.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp.mailchimp__segments"}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_activities_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "STRING", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 9, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 783.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__members_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "STRING", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "STRING", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "STRING", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "STRING", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "STRING", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "TIMESTAMP", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "FLOAT64", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "STRING", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "INT64", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "STRING", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "TIMESTAMP", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "TIMESTAMP", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "STRING", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 24, "name": "vip", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1841.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_emails_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "STRING", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "INT64", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "STRING", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "STRING", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 39, "name": "use_conversation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__unsubscribes", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}, "unsubscribe_reason": {"type": "INT64", "index": 4, "name": "unsubscribe_reason", "comment": null}, "unsubscribe_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "unsubscribe_timestamp", "comment": null}, "unsubscribe_id": {"type": "STRING", "index": 6, "name": "unsubscribe_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 100.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes"}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__lists_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "STRING", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "STRING", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 26, "name": "visibility", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 380.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_activities_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "STRING", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 10, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1719.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaigns_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "STRING", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "STRING", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "STRING", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "INT64", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "STRING", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "STRING", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "BOOL", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 40, "name": "winning_combination_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 318.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp"}, "model.mailchimp_source.stg_mailchimp__automations": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automations", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"automation_id": {"type": "STRING", "index": 1, "name": "automation_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 3, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 4, "name": "segment_text", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "started_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "created_timestamp", "comment": null}, "status": {"type": "STRING", "index": 7, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 9, "name": "trigger_settings", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 287.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automations"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "combination_id": {"type": "INT64", "index": 3, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "email_id": {"type": "STRING", "index": 5, "name": "email_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 920.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients"}, "model.mailchimp_source.stg_mailchimp__automations_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automations_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 9, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 11, "name": "trigger_settings", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 296.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp"}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__unsubscribes_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "INT64", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 6, "name": "timestamp", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 74.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "INT64", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 660.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_recipients", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}, "automation_recipient_id": {"type": "STRING", "index": 4, "name": "automation_recipient_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 184.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients"}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segments_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "type": {"type": "STRING", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 9, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 71.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp"}, "model.mailchimp_source.stg_mailchimp__members": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__members", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "email_address": {"type": "STRING", "index": 2, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 3, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 4, "name": "email_type", "comment": null}, "status": {"type": "STRING", "index": 5, "name": "status", "comment": null}, "list_id": {"type": "STRING", "index": 6, "name": "list_id", "comment": null}, "signup_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "signup_timestamp", "comment": null}, "opt_in_timestamp": {"type": "TIMESTAMP", "index": 8, "name": "opt_in_timestamp", "comment": null}, "last_changed_timestamp": {"type": "TIMESTAMP", "index": 9, "name": "last_changed_timestamp", "comment": null}, "country_code": {"type": "STRING", "index": 10, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 11, "name": "dstoff", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 12, "name": "gmtoff", "comment": null}, "opt_in_ip_address": {"type": "STRING", "index": 13, "name": "opt_in_ip_address", "comment": null}, "signup_ip_address": {"type": "STRING", "index": 14, "name": "signup_ip_address", "comment": null}, "language": {"type": "STRING", "index": 15, "name": "language", "comment": null}, "latitude": {"type": "FLOAT64", "index": 16, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 17, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 18, "name": "member_rating", "comment": null}, "timezone": {"type": "STRING", "index": 19, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 20, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 21, "name": "vip", "comment": null}, "list_member_id": {"type": "STRING", "index": 22, "name": "list_member_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2013.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__members"}, "model.mailchimp_source.stg_mailchimp__segments": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segments", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 3, "name": "member_count", "comment": null}, "segment_name": {"type": "STRING", "index": 4, "name": "segment_name", "comment": null}, "segment_type": {"type": "STRING", "index": 5, "name": "segment_type", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "updated_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "created_timestamp", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 62.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segments"}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_recipients_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 132.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__segment_members": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segment_members", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}, "segment_member_id": {"type": "STRING", "index": 4, "name": "segment_member_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 176.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members"}, "model.mailchimp_source.stg_mailchimp__campaigns": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaigns", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "create_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "create_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "send_timestamp", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "reply_to_email": {"type": "STRING", "index": 6, "name": "reply_to_email", "comment": null}, "campaign_type": {"type": "STRING", "index": 7, "name": "campaign_type", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "archive_url": {"type": "STRING", "index": 9, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 10, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 11, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 12, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 13, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 14, "name": "content_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 15, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 16, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 17, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 18, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 19, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 20, "name": "inline_css", "comment": null}, "long_archive_url": {"type": "STRING", "index": 21, "name": "long_archive_url", "comment": null}, "status": {"type": "STRING", "index": 22, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 23, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 24, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 25, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 26, "name": "timewarp", "comment": null}, "to_name": {"type": "STRING", "index": 27, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 28, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 29, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 30, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 31, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 32, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "BOOL", "index": 33, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 34, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 35, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 36, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 37, "name": "winning_combination_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 309.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns"}, "model.mailchimp_source.stg_mailchimp__lists": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__lists", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"list_id": {"type": "STRING", "index": 1, "name": "list_id", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 2, "name": "date_created", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 4, "name": "list_rating", "comment": null}, "beamer_address": {"type": "STRING", "index": 5, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 6, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 7, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 8, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 9, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 10, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 11, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 12, "name": "contact_zip", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 18, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 19, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 20, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 21, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 22, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 23, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 24, "name": "visibility", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 371.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__lists"}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segment_members_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 126.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_activities", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "activity_id": {"type": "STRING", "index": 9, "name": "activity_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 965.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities"}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_emails", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "automation_id": {"type": "STRING", "index": 2, "name": "automation_id", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "created_timestamp", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "started_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "send_timestamp", "comment": null}, "from_name": {"type": "STRING", "index": 6, "name": "from_name", "comment": null}, "reply_to": {"type": "STRING", "index": 7, "name": "reply_to", "comment": null}, "status": {"type": "STRING", "index": 8, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 9, "name": "subject_line", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 11, "name": "to_name", "comment": null}, "archive_url": {"type": "STRING", "index": 12, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 13, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 14, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 15, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "INT64", "index": 16, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 17, "name": "content_type", "comment": null}, "delay_action": {"type": "STRING", "index": 18, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 19, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 20, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 21, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 22, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 23, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 24, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 25, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 26, "name": "folder_id", "comment": null}, "google_analytics": {"type": "STRING", "index": 27, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 28, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 29, "name": "position", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 32, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 33, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 34, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 35, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 36, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 37, "name": "use_conversation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 343.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails"}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_activities", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 9, "name": "combination_id", "comment": null}, "activity_id": {"type": "STRING", "index": 10, "name": "activity_id", "comment": null}, "email_id": {"type": "STRING", "index": 11, "name": "email_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2739.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities"}}, "sources": {"source.mailchimp_source.mailchimp.automation": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 9, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 11, "name": "trigger_settings", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 296.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation"}, "source.mailchimp_source.mailchimp.automation_email": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_email", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "STRING", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "INT64", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "STRING", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "STRING", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 39, "name": "use_conversation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_email"}, "source.mailchimp_source.mailchimp.member": {"metadata": {"type": "table", "schema": "mailchimp", "name": "member", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "STRING", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "STRING", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "STRING", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "STRING", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "STRING", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "TIMESTAMP", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "FLOAT64", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "STRING", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "INT64", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "STRING", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "TIMESTAMP", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "TIMESTAMP", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "STRING", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 24, "name": "vip", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1841.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.member"}, "source.mailchimp_source.mailchimp.list": {"metadata": {"type": "table", "schema": "mailchimp", "name": "list", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "STRING", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "STRING", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 26, "name": "visibility", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 380.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.list"}, "source.mailchimp_source.mailchimp.unsubscribe": {"metadata": {"type": "table", "schema": "mailchimp", "name": "unsubscribe", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "INT64", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 6, "name": "timestamp", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 74.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.unsubscribe"}, "source.mailchimp_source.mailchimp.campaign": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "STRING", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "STRING", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "STRING", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "INT64", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "STRING", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "STRING", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "BOOL", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 40, "name": "winning_combination_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 318.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign"}, "source.mailchimp_source.mailchimp.segment": {"metadata": {"type": "table", "schema": "mailchimp", "name": "segment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "type": {"type": "STRING", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 9, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 71.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.segment"}, "source.mailchimp_source.mailchimp.campaign_recipient": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign_recipient", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "INT64", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 660.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient"}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign_recipient_activity", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "STRING", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 10, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1719.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient_activity"}, "source.mailchimp_source.mailchimp.automation_recipient": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_recipient", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 132.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_recipient"}, "source.mailchimp_source.mailchimp.segment_member": {"metadata": {"type": "table", "schema": "mailchimp", "name": "segment_member", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 126.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.segment_member"}, "source.mailchimp_source.mailchimp.automation_recipient_activity": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_recipient_activity", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "STRING", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 9, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 783.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_recipient_activity"}}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index ee9f2978..fa8b08b7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
icons
- diff --git a/docs/manifest.json b/docs/manifest.json index 2bb4b6b8..835185a2 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v2.json", "dbt_version": "0.20.2", "generated_at": "2021-10-22T16:09:21.222674Z", "invocation_id": "0e869736-6313-46cf-8816-33e49d6a2328", "env": {}, "project_id": "faebc42304447d4427374f806679ecb5", "user_id": "e607f749-4294-4b15-833b-0ae4a87d4d24", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"model.mailchimp_source.stg_mailchimp__segments": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segments_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segments_tmp')),\n staging_columns=get_segment_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segments"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__segments.sql", "original_file_path": "models/stg_mailchimp__segments.sql", "name": "stg_mailchimp__segments", "alias": "stg_mailchimp__segments", "checksum": {"name": "sha256", "checksum": "9a541d259b8016fe2430ed426ebf18b892a675e034a30ad5c0ac1b53337e5d8d"}, "tags": [], "refs": [["stg_mailchimp__segments_tmp"], ["stg_mailchimp__segments_tmp"]], "sources": [], "description": "Each record represents a segment in Mailchimp.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_name": {"name": "segment_name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_type": {"name": "segment_type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_count\n \n as \n \n member_count\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_recipients_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_recipients_tmp')),\n staging_columns=get_campaign_recipient_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__campaign_recipients.sql", "original_file_path": "models/stg_mailchimp__campaign_recipients.sql", "name": "stg_mailchimp__campaign_recipients", "alias": "stg_mailchimp__campaign_recipients", "checksum": {"name": "sha256", "checksum": "962d18c80e7e0267bb0e229f1753457fb9be4f88fb9794590dddd173811d0c3a"}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients_tmp"], ["stg_mailchimp__campaign_recipients_tmp"]], "sources": [], "description": "Each record represents the send of a campaign email.", "columns": {"email_id": {"name": "email_id", "description": "The surrogate key that uses table campaign_id and member_id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918964, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n to_hex(md5(cast(coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') as \n string\n))) as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`"}, "model.mailchimp_source.stg_mailchimp__lists": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__lists_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__lists_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_list_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__lists"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__lists.sql", "original_file_path": "models/stg_mailchimp__lists.sql", "name": "stg_mailchimp__lists", "alias": "stg_mailchimp__lists", "checksum": {"name": "sha256", "checksum": "4d6a8a6e5f037e2b841245e3006ce38a78ae09f8fb01bc3d520f81d6242f46a5"}, "tags": [], "refs": [["stg_mailchimp__lists_tmp"], ["stg_mailchimp__lists_tmp"]], "sources": [], "description": "Each record represents a list in Mailchimp.", "columns": {"list_id": {"name": "list_id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__lists.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918964, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n beamer_address\n \n as \n \n beamer_address\n \n, \n \n \n contact_address_1\n \n as \n \n contact_address_1\n \n, \n \n \n contact_address_2\n \n as \n \n contact_address_2\n \n, \n \n \n contact_city\n \n as \n \n contact_city\n \n, \n \n \n contact_company\n \n as \n \n contact_company\n \n, \n \n \n contact_country\n \n as \n \n contact_country\n \n, \n \n \n contact_state\n \n as \n \n contact_state\n \n, \n \n \n contact_zip\n \n as \n \n contact_zip\n \n, \n \n \n date_created\n \n as \n \n date_created\n \n, \n \n \n default_from_email\n \n as \n \n default_from_email\n \n, \n \n \n default_from_name\n \n as \n \n default_from_name\n \n, \n \n \n default_language\n \n as \n \n default_language\n \n, \n \n \n default_subject\n \n as \n \n default_subject\n \n, \n \n \n email_type_option\n \n as \n \n email_type_option\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_rating\n \n as \n \n list_rating\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notify_on_subscribe\n \n as \n \n notify_on_subscribe\n \n, \n \n \n notify_on_unsubscribe\n \n as \n \n notify_on_unsubscribe\n \n, \n \n \n permission_reminder\n \n as \n \n permission_reminder\n \n, \n \n \n subscribe_url_long\n \n as \n \n subscribe_url_long\n \n, \n \n \n subscribe_url_short\n \n as \n \n subscribe_url_short\n \n, \n \n \n use_archive_bar\n \n as \n \n use_archive_bar\n \n, \n \n \n visibility\n \n as \n \n visibility\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`"}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_activities_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_activities_tmp')),\n staging_columns=get_automation_recipient_activity_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['action_type', 'automation_email_id', 'member_id', 'activity_timestamp']) }} as activity_id\n from final\n)\n\nselect * from unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automation_activities.sql", "original_file_path": "models/stg_mailchimp__automation_activities.sql", "name": "stg_mailchimp__automation_activities", "alias": "stg_mailchimp__automation_activities", "checksum": {"name": "sha256", "checksum": "8f14be4acd168cb711c17e39998f9170001c7e2cbb9259a6561bc2c9b9164d17"}, "tags": [], "refs": [["stg_mailchimp__automation_activities_tmp"], ["stg_mailchimp__automation_activities_tmp"]], "sources": [], "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith base as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(action_type as \n string\n), '') || '-' || coalesce(cast(automation_email_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(activity_timestamp as \n string\n), '') as \n string\n))) as activity_id\n from final\n)\n\nselect * from unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`"}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__unsubscribes_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__unsubscribes_tmp')),\n staging_columns=get_unsubscribe_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key([ 'member_id', 'list_id', 'unsubscribe_timestamp']) }} as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_unsubscribe_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__unsubscribes"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__unsubscribes.sql", "original_file_path": "models/stg_mailchimp__unsubscribes.sql", "name": "stg_mailchimp__unsubscribes", "alias": "stg_mailchimp__unsubscribes", "checksum": {"name": "sha256", "checksum": "84ac8d45eb7917b03369f407770d7e279978cdd84d657c085c788524f7600e02"}, "tags": [], "refs": [["stg_mailchimp__unsubscribes_tmp"], ["stg_mailchimp__unsubscribes_tmp"]], "sources": [], "description": "Each record represents a member who unsubscribed.", "columns": {"unsubscribe_id": {"name": "unsubscribe_id", "description": "The surrogate key that uses table member_id, list_id, and unsubscribe_timestamp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__unsubscribes.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918964, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n reason\n \n as \n \n reason\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(list_id as \n string\n), '') || '-' || coalesce(cast(unsubscribe_timestamp as \n string\n), '') as \n string\n))) as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`"}, "model.mailchimp_source.stg_mailchimp__campaigns": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaigns_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaigns_tmp')),\n staging_columns=get_campaign_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaigns"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__campaigns.sql", "original_file_path": "models/stg_mailchimp__campaigns.sql", "name": "stg_mailchimp__campaigns", "alias": "stg_mailchimp__campaigns", "checksum": {"name": "sha256", "checksum": "56693d69d8c258df63e0d9bedc7606959093d93608786b62065df629537f7e96"}, "tags": [], "refs": [["stg_mailchimp__campaigns_tmp"], ["stg_mailchimp__campaigns_tmp"]], "sources": [], "description": "Each record represents a campaign in Mailchimp.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_timestamp": {"name": "create_timestamp", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to_email": {"name": "reply_to_email", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaigns.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918964, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n long_archive_url\n \n as \n \n long_archive_url\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n test_size\n \n as \n \n test_size\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n, \n \n \n wait_time\n \n as \n \n wait_time\n \n, \n \n \n winner_criteria\n \n as \n \n winner_criteria\n \n, \n \n \n winning_campaign_id\n \n as \n \n winning_campaign_id\n \n, \n \n \n winning_combination_id\n \n as \n \n winning_combination_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`"}, "model.mailchimp_source.stg_mailchimp__automations": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__automations_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automations_tmp')),\n staging_columns=get_automation_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automations"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automations.sql", "original_file_path": "models/stg_mailchimp__automations.sql", "name": "stg_mailchimp__automations", "alias": "stg_mailchimp__automations", "checksum": {"name": "sha256", "checksum": "d53e4be91338f237ad9434b3962987eea297a7259b2109096f46c8a04df49144"}, "tags": [], "refs": [["stg_mailchimp__automations_tmp"], ["stg_mailchimp__automations_tmp"]], "sources": [], "description": "Each record represents an automation in Mailchimp.", "columns": {"automation_id": {"name": "automation_id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automations.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n trigger_settings\n \n as \n \n trigger_settings\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`"}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_emails_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_emails_tmp')),\n staging_columns=get_automation_email_columns()\n )\n }}\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_email_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_emails"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automation_emails.sql", "original_file_path": "models/stg_mailchimp__automation_emails.sql", "name": "stg_mailchimp__automation_emails", "alias": "stg_mailchimp__automation_emails", "checksum": {"name": "sha256", "checksum": "d4a7ad6a314a52074f4cc4486a63f7f1f1f9bf7b89605427d38c10fa33bf9f38"}, "tags": [], "refs": [["stg_mailchimp__automation_emails_tmp"], ["stg_mailchimp__automation_emails_tmp"]], "sources": [], "description": "Each record represents an automation email (that make up automations).", "columns": {"automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_emails.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith base as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n automation_id\n \n as \n \n automation_id\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n delay_action\n \n as \n \n delay_action\n \n, \n \n \n delay_action_description\n \n as \n \n delay_action_description\n \n, \n \n \n delay_amount\n \n as \n \n delay_amount\n \n, \n \n \n delay_direction\n \n as \n \n delay_direction\n \n, \n \n \n delay_full_description\n \n as \n \n delay_full_description\n \n, \n \n \n delay_type\n \n as \n \n delay_type\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n position\n \n as \n \n position\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n\n\n\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`"}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_recipients_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_recipients_tmp')),\n staging_columns=get_automation_recipient_columns()\n )\n }}\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n {{ dbt_utils.surrogate_key(['member_id','automation_email_id']) }} as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automation_recipients.sql", "original_file_path": "models/stg_mailchimp__automation_recipients.sql", "name": "stg_mailchimp__automation_recipients", "alias": "stg_mailchimp__automation_recipients", "checksum": {"name": "sha256", "checksum": "0b527204f8677d081d0c2ee753e4dcc39e166176599674729ab183e1ceeab443"}, "tags": [], "refs": [["stg_mailchimp__automation_recipients_tmp"], ["stg_mailchimp__automation_recipients_tmp"]], "sources": [], "description": "Each record represents info about the recipient of each automation.", "columns": {"automation_recipient_id": {"name": "automation_recipient_id", "description": "Surrogate key that uses member_id and automation_email_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith base as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n to_hex(md5(cast(coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(automation_email_id as \n string\n), '') as \n string\n))) as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`"}, "model.mailchimp_source.stg_mailchimp__members": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__members_tmp')),\n staging_columns=get_member_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n {{ fivetran_utils.fill_pass_through_columns('mailchimp__members_pass_through_columns') }}\n \n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_member_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__members"], "unique_id": "model.mailchimp_source.stg_mailchimp__members", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__members.sql", "original_file_path": "models/stg_mailchimp__members.sql", "name": "stg_mailchimp__members", "alias": "stg_mailchimp__members", "checksum": {"name": "sha256", "checksum": "0f1845646b840c30faa0cd9a863899b592ca5cb9307fba2e81829fc85aa038a0"}, "tags": [], "refs": [["stg_mailchimp__members_tmp"], ["stg_mailchimp__members_tmp"]], "sources": [], "description": "Each record represents a member in Mailchimp.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_timestamp": {"name": "signup_timestamp", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_timestamp": {"name": "opt_in_timestamp", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed_timestamp": {"name": "last_changed_timestamp", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_ip_address": {"name": "opt_in_ip_address", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_ip_address": {"name": "signup_ip_address", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918964, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n dstoff\n \n as \n \n dstoff\n \n, \n \n \n email_address\n \n as \n \n email_address\n \n, \n \n \n email_client\n \n as \n \n email_client\n \n, \n \n \n email_type\n \n as \n \n email_type\n \n, \n \n \n gmtoff\n \n as \n \n gmtoff\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n ip_opt\n \n as \n \n ip_opt\n \n, \n \n \n ip_signup\n \n as \n \n ip_signup\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n last_changed\n \n as \n \n last_changed\n \n, \n \n \n latitude\n \n as \n \n latitude\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n longitude\n \n as \n \n longitude\n \n, \n \n \n member_rating\n \n as \n \n member_rating\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n timestamp_opt\n \n as \n \n timestamp_opt\n \n, \n \n \n timestamp_signup\n \n as \n \n timestamp_signup\n \n, \n \n \n timezone\n \n as \n \n timezone\n \n, \n \n \n unique_email_id\n \n as \n \n unique_email_id\n \n, \n \n \n vip\n \n as \n \n vip\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n \n\n\n\n\n \n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`"}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_activities_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_activities_tmp')),\n staging_columns=get_campaign_recipient_activity_columns()\n )\n }}\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['action_type', 'campaign_id', 'member_id', 'activity_timestamp']) }} as activity_id,\n {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__campaign_activities.sql", "original_file_path": "models/stg_mailchimp__campaign_activities.sql", "name": "stg_mailchimp__campaign_activities", "alias": "stg_mailchimp__campaign_activities", "checksum": {"name": "sha256", "checksum": "8d4a84a98808c477676406497afd536b55e88dd028845c96dc2912a52abe06cc"}, "tags": [], "refs": [["stg_mailchimp__campaign_activities_tmp"], ["stg_mailchimp__campaign_activities_tmp"]], "sources": [], "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_id": {"name": "email_id", "description": "The ID of the email sent. (Created in dbt, not Mailchimp.)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918964, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(action_type as \n string\n), '') || '-' || coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(activity_timestamp as \n string\n), '') as \n string\n))) as activity_id,\n to_hex(md5(cast(coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') as \n string\n))) as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`"}, "model.mailchimp_source.stg_mailchimp__segment_members": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segment_members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segment_members_tmp')),\n staging_columns=get_segment_member_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_member_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segment_members"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__segment_members.sql", "original_file_path": "models/stg_mailchimp__segment_members.sql", "name": "stg_mailchimp__segment_members", "alias": "stg_mailchimp__segment_members", "checksum": {"name": "sha256", "checksum": "86acbc06483f991f2e5a9f970cc458041efbc105b949237f707432ed6c354c35"}, "tags": [], "refs": [["stg_mailchimp__segment_members_tmp"], ["stg_mailchimp__segment_members_tmp"]], "sources": [], "description": "Each record represents a member and their segment data.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segment_members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members`"}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient_activity') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient_activity"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automation_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_activities_tmp.sql", "name": "stg_mailchimp__automation_activities_tmp", "alias": "stg_mailchimp__automation_activities_tmp", "checksum": {"name": "sha256", "checksum": "99dd3be31bece932a946f44c80ffe85b9b21d998ddaf1d7a4fb9108f9b4f3566"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient_activity"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation_recipient_activity`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities_tmp`"}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"raw_sql": "select * from {{ var('unsubscribe') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.unsubscribe"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__unsubscribes_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__unsubscribes_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "name": "stg_mailchimp__unsubscribes_tmp", "alias": "stg_mailchimp__unsubscribes_tmp", "checksum": {"name": "sha256", "checksum": "49ddeb7631aa624011d6fd5f608b80fa284ca6443a837c941d31cc864e99efca"}, "tags": [], "refs": [], "sources": [["mailchimp", "unsubscribe"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918963, "compiled_sql": "select * from `bigquery`.`mailchimp`.`unsubscribe`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes_tmp`"}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"raw_sql": "select * from {{ var('list') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.list"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__lists_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__lists_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__lists_tmp.sql", "name": "stg_mailchimp__lists_tmp", "alias": "stg_mailchimp__lists_tmp", "checksum": {"name": "sha256", "checksum": "f2334dfd1f22372c81a53cb1903dc8accef34fbf98c0a3477bd0ca373cffd83d"}, "tags": [], "refs": [], "sources": [["mailchimp", "list"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__lists_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918963, "compiled_sql": "select * from `bigquery`.`mailchimp`.`list`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"raw_sql": "select * from {{ var('campaign_recipient') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "name": "stg_mailchimp__campaign_recipients_tmp", "alias": "stg_mailchimp__campaign_recipients_tmp", "checksum": {"name": "sha256", "checksum": "6208dd636a377fb8462ee7838ec92a9b3592f5861f42c6dd803aa8c32e6fe3f5"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918963, "compiled_sql": "select * from `bigquery`.`mailchimp`.`campaign_recipient`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients_tmp`"}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('mailchimp_segment') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segments_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__segments_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segments_tmp.sql", "name": "stg_mailchimp__segments_tmp", "alias": "stg_mailchimp__segments_tmp", "checksum": {"name": "sha256", "checksum": "4235011fcab4cb786bf93907ba23fa09882a56e9430b6fc13bf0425c2cb5cc09"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segments_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`segment`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"raw_sql": "select * from {{ var('campaign') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaigns_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__campaigns_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaigns_tmp.sql", "name": "stg_mailchimp__campaigns_tmp", "alias": "stg_mailchimp__campaigns_tmp", "checksum": {"name": "sha256", "checksum": "b96a24c9964cf05208bd2a9e0d0ce0455a507b9f07026887f777922df4942cd9"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaigns_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918963, "compiled_sql": "select * from `bigquery`.`mailchimp`.`campaign`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns_tmp`"}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('segment_member') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment_member"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segment_members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__segment_members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segment_members_tmp.sql", "name": "stg_mailchimp__segment_members_tmp", "alias": "stg_mailchimp__segment_members_tmp", "checksum": {"name": "sha256", "checksum": "5b6ac15d76b277f0b9f4d99dab168471e7e599bf8e79bd491dc412cfd5e9b48b"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment_member"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segment_members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`segment_member`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members_tmp`"}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"raw_sql": "select * from {{ var('member') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.member"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__members_tmp.sql", "name": "stg_mailchimp__members_tmp", "alias": "stg_mailchimp__members_tmp", "checksum": {"name": "sha256", "checksum": "5fe9a82d5a301c2dd82f196d47d882b6c2083528bd8b53f1a49591496b729b5e"}, "tags": [], "refs": [], "sources": [["mailchimp", "member"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918963, "compiled_sql": "select * from `bigquery`.`mailchimp`.`member`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members_tmp`"}, "model.mailchimp_source.stg_mailchimp__automations_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automations_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automations_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automations_tmp.sql", "name": "stg_mailchimp__automations_tmp", "alias": "stg_mailchimp__automations_tmp", "checksum": {"name": "sha256", "checksum": "2d97a5eacee487f94b5553490b28db0d5252d917897965fa442e884a547e78d3"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automations_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations_tmp`"}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_email') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_email"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_emails_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automation_emails_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_emails_tmp.sql", "name": "stg_mailchimp__automation_emails_tmp", "alias": "stg_mailchimp__automation_emails_tmp", "checksum": {"name": "sha256", "checksum": "9ee9a3419a66bfb12b2c084315fdf33a0751480aa6b206c201cfb3feca13a465"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_email"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_emails_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation_email`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails_tmp`"}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automation_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "name": "stg_mailchimp__automation_recipients_tmp", "alias": "stg_mailchimp__automation_recipients_tmp", "checksum": {"name": "sha256", "checksum": "28eeb5e9f065dcf688d7bff8b450ba06adb13628fe476e0091d49740ed8b1241"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation_recipient`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"raw_sql": "select * from {{ var('campaign_recipient_activity') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "name": "stg_mailchimp__campaign_activities_tmp", "alias": "stg_mailchimp__campaign_activities_tmp", "checksum": {"name": "sha256", "checksum": "50e7e9bdfd1bded394388edd76798d6b59b30bbfac7181e2e108401c179c9e78"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient_activity"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918963, "compiled_sql": "select * from `bigquery`.`mailchimp`.`campaign_recipient_activity`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities_tmp`"}, "model.mailchimp.mailchimp__automation_activities": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ var('automation_recipient_activity') }}\n\n), automation_emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n activities.*,\n automations.automation_id,\n automations.segment_id\n from activities\n left join automation_emails\n on activities.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__automation_activities"], "unique_id": "model.mailchimp.mailchimp__automation_activities", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__automation_activities.sql", "original_file_path": "models/mailchimp__automation_activities.sql", "name": "mailchimp__automation_activities", "alias": "mailchimp__automation_activities", "checksum": {"name": "sha256", "checksum": "3f19dfa1aa531de4dab8bb860b585e2db4c3848b6959da197da19a106813f40a"}, "tags": [], "refs": [["stg_mailchimp__automation_activities"], ["stg_mailchimp__automation_emails"], ["stg_mailchimp__automations"]], "sources": [], "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID for the automation that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID for the Segment that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__automation_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n activities.*,\n automations.automation_id,\n automations.segment_id\n from activities\n left join automation_emails\n on activities.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`"}, "model.mailchimp.mailchimp__lists": {"raw_sql": "with lists as (\n\n select *\n from {{ var('list')}}\n\n), campaign_activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_list') }}\n\n), members as (\n\n select *\n from {{ ref('int_mailchimp__members_by_list') }}\n\n), members_xf as (\n\n select \n lists.*,\n coalesce(members.count_members,0) as count_members,\n members.most_recent_signup_timestamp\n from lists\n left join members\n on lists.list_id = members.list_id\n\n), metrics as (\n\n select \n members_xf.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members_xf\n left join campaign_activities\n on members_xf.list_id = campaign_activities.list_id\n\n{% if var('mailchimp_using_automations', True) %}\n\n), automation_activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_list') }}\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.list_id = automation_activities.list_id\n\n)\n\nselect *\nfrom metrics_xf\n\n{% else %}\n\n)\n\nselect *\nfrom metrics \n\n{% endif %}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp.int_mailchimp__campaign_activities_by_list", "model.mailchimp.int_mailchimp__members_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_list"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__lists"], "unique_id": "model.mailchimp.mailchimp__lists", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__lists.sql", "original_file_path": "models/mailchimp__lists.sql", "name": "mailchimp__lists", "alias": "mailchimp__lists", "checksum": {"name": "sha256", "checksum": "f2544a3b568ba214f586dd746088f0fa38ae8dc3b1ce6c362368c65637ef5c95"}, "tags": [], "refs": [["stg_mailchimp__lists"], ["int_mailchimp__campaign_activities_by_list"], ["int_mailchimp__members_by_list"], ["int_mailchimp__automation_activities_by_list"]], "sources": [], "description": "Each record represents a list in Mailchimp, enriched with campaign metrics, (optionally) automation metrics and information about members.", "columns": {"list_id": {"name": "list_id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "count_members": {"name": "count_members", "description": "The number of members in a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "most_recent_signup_timestamp": {"name": "most_recent_signup_timestamp", "description": "The date of the most recent signup to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_sends": {"name": "campaign_sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_opens": {"name": "campaign_opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_clicks": {"name": "campaign_clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_opens": {"name": "campaign_unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_clicks": {"name": "campaign_unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unsubscribes": {"name": "campaign_unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_sends": {"name": "automation_sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_opens": {"name": "automation_opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_clicks": {"name": "automation_clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_opens": {"name": "automation_unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_clicks": {"name": "automation_unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unsubscribes": {"name": "automation_unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__lists.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1634918964, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_list as (\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n), __dbt__cte__int_mailchimp__members_by_list as (\nwith members as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__members`\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list\n), __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_list as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined\n),lists as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\n\n), campaign_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_list\n\n), members as (\n\n select *\n from __dbt__cte__int_mailchimp__members_by_list\n\n), members_xf as (\n\n select \n lists.*,\n coalesce(members.count_members,0) as count_members,\n members.most_recent_signup_timestamp\n from lists\n left join members\n on lists.list_id = members.list_id\n\n), metrics as (\n\n select \n members_xf.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members_xf\n left join campaign_activities\n on members_xf.list_id = campaign_activities.list_id\n\n\n\n), automation_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_list\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.list_id = automation_activities.list_id\n\n)\n\nselect *\nfrom metrics_xf\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_list", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_list as (\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}, {"id": "model.mailchimp.int_mailchimp__members_by_list", "sql": " __dbt__cte__int_mailchimp__members_by_list as (\nwith members as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__members`\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_list", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_list as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__lists`"}, "model.mailchimp.mailchimp__members": {"raw_sql": "with members as (\n\n select *\n from {{ var('member')}}\n\n), campaign_activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_member') }}\n\n), metrics as (\n\n select \n members.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members\n left join campaign_activities\n on members.member_id = campaign_activities.member_id\n\n{% if var('mailchimp_using_automations', True) %}\n\n), automation_activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_member') }}\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.member_id = automation_activities.member_id\n\n)\n\nselect *\nfrom metrics_xf\n\n{% else %}\n\n)\n\nselect *\nfrom metrics \n\n{% endif %}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__members", "model.mailchimp.int_mailchimp__campaign_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_member"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__members"], "unique_id": "model.mailchimp.mailchimp__members", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__members.sql", "original_file_path": "models/mailchimp__members.sql", "name": "mailchimp__members", "alias": "mailchimp__members", "checksum": {"name": "sha256", "checksum": "d4450db1829e3770f05a760daf7b5d6a8da3ecc50012aaea0db52d61779bdaae"}, "tags": [], "refs": [["stg_mailchimp__members"], ["int_mailchimp__campaign_activities_by_member"], ["int_mailchimp__automation_activities_by_member"]], "sources": [], "description": "Each record represents a member in Mailchimp, enriched with campaign metrics and (optionally) automation metrics.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_timestamp": {"name": "signup_timestamp", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_timestamp": {"name": "opt_in_timestamp", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed_timestamp": {"name": "last_changed_timestamp", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_ip_address": {"name": "opt_in_ip_address", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_ip_address": {"name": "signup_ip_address", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_sends": {"name": "campaign_sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_opens": {"name": "campaign_opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_clicks": {"name": "campaign_clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_opens": {"name": "campaign_unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_clicks": {"name": "campaign_unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unsubscribes": {"name": "campaign_unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_sends": {"name": "automation_sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_opens": {"name": "automation_opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_clicks": {"name": "automation_clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_opens": {"name": "automation_unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_clicks": {"name": "automation_unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unsubscribes": {"name": "automation_unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__members.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1634918964, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_member as (\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n), __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_member as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined\n),members as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\n\n), campaign_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_member\n\n), metrics as (\n\n select \n members.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members\n left join campaign_activities\n on members.member_id = campaign_activities.member_id\n\n\n\n), automation_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_member\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.member_id = automation_activities.member_id\n\n)\n\nselect *\nfrom metrics_xf\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_member", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_member as (\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_member", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_member as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__members`"}, "model.mailchimp.mailchimp__campaigns": {"raw_sql": "with campaigns as (\n\n select *\n from {{ var('campaign')}}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_campaign') }}\n\n), joined as (\n\n select \n campaigns.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from campaigns\n left join activities\n on campaigns.campaign_id = activities.campaign_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp.int_mailchimp__campaign_activities_by_campaign"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__campaigns"], "unique_id": "model.mailchimp.mailchimp__campaigns", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__campaigns.sql", "original_file_path": "models/mailchimp__campaigns.sql", "name": "mailchimp__campaigns", "alias": "mailchimp__campaigns", "checksum": {"name": "sha256", "checksum": "c017738b04b6f5b686197a385d5f237977c68011fd4f8b2ea1f039af5fb1abb0"}, "tags": [], "refs": [["stg_mailchimp__campaigns"], ["int_mailchimp__campaign_activities_by_campaign"]], "sources": [], "description": "Each record represents a campaign in Mailchimp, enriched with click, open and unsubscribe metrics.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_timestamp": {"name": "create_timestamp", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to_email": {"name": "reply_to_email", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sends": {"name": "sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unsubscribes": {"name": "unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__campaigns.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1634918964, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_campaign as (\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n),campaigns as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_campaign\n\n), joined as (\n\n select \n campaigns.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from campaigns\n left join activities\n on campaigns.campaign_id = activities.campaign_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_campaign as (\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaigns`"}, "model.mailchimp.mailchimp__campaign_activities": {"raw_sql": "with activities as (\n\n select *\n from {{ ref('stg_mailchimp__campaign_activities') }}\n\n), campaigns as (\n\n select *\n from {{ var('campaign') }}\n\n), since_send as (\n\n select \n activities.*,\n campaigns.send_timestamp,\n {{ dbt_utils.datediff('campaigns.send_timestamp','activities.activity_timestamp','minute') }} as time_since_send_minutes,\n {{ dbt_utils.datediff('campaigns.send_timestamp','activities.activity_timestamp','hour') }} as time_since_send_hours,\n {{ dbt_utils.datediff('campaigns.send_timestamp','activities.activity_timestamp','day') }} as time_since_send_days\n from activities\n left join campaigns\n on activities.campaign_id = campaigns.campaign_id\n\n)\n\nselect *\nfrom since_send", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.datediff"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__campaign_activities"], "unique_id": "model.mailchimp.mailchimp__campaign_activities", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__campaign_activities.sql", "original_file_path": "models/mailchimp__campaign_activities.sql", "name": "mailchimp__campaign_activities", "alias": "mailchimp__campaign_activities", "checksum": {"name": "sha256", "checksum": "10540a96eb968a2a16c8e26d711a30d18d583f575445bc8157bfffa5f473d5b4"}, "tags": [], "refs": [["stg_mailchimp__campaign_activities"], ["stg_mailchimp__campaigns"]], "sources": [], "description": "Each record represents an activity taken in relation to a campaign email, enriched with data about when the campaign was sent and the lag between send and the activity.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_id": {"name": "email_id", "description": "The ID of the email sent. (Created in dbt, not Mailchimp.)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The time the campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_since_send_minutes": {"name": "time_since_send_minutes", "description": "The time from send to activity in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_since_send_hours": {"name": "time_since_send_hours", "description": "The time from send to activity in hours.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_since_send_days": {"name": "time_since_send_days", "description": "The time from send to activity in days.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__campaign_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1634918964, "compiled_sql": "with activities as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\n\n), campaigns as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\n\n), since_send as (\n\n select \n activities.*,\n campaigns.send_timestamp,\n \n\n datetime_diff(\n cast(activities.activity_timestamp as datetime),\n cast(campaigns.send_timestamp as datetime),\n minute\n )\n\n as time_since_send_minutes,\n \n\n datetime_diff(\n cast(activities.activity_timestamp as datetime),\n cast(campaigns.send_timestamp as datetime),\n hour\n )\n\n as time_since_send_hours,\n \n\n datetime_diff(\n cast(activities.activity_timestamp as datetime),\n cast(campaigns.send_timestamp as datetime),\n day\n )\n\n as time_since_send_days\n from activities\n left join campaigns\n on activities.campaign_id = campaigns.campaign_id\n\n)\n\nselect *\nfrom since_send", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`"}, "model.mailchimp.mailchimp__campaign_recipients": {"raw_sql": "with recipients as (\n \n select *\n from {{ var('campaign_recipient') }}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_email') }}\n\n), unsubscribes as (\n\n select *\n from {{ var('unsubscribe') }}\n\n), campaigns as (\n\n select *\n from {{ var('campaign') }}\n\n), joined as (\n\n select \n recipients.*,\n campaigns.segment_id,\n campaigns.send_timestamp\n from recipients\n left join campaigns\n on recipients.campaign_id = campaigns.campaign_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.was_opened, False) as was_opened,\n coalesce(activities.was_clicked, False) as was_clicked,\n activities.first_open_timestamp,\n activities.time_to_open_minutes,\n activities.time_to_open_hours,\n activities.time_to_open_days\n from joined\n left join activities\n on joined.email_id = activities.email_id\n\n), unsubscribes_xf as (\n\n select \n member_id,\n campaign_id\n from unsubscribes\n group by 1,2\n\n), metrics_xf as (\n\n select \n metrics.*,\n case when unsubscribes_xf.member_id is not null then True else False end as was_unsubscribed\n from metrics\n left join unsubscribes_xf\n on metrics.member_id = unsubscribes_xf.member_id\n and metrics.campaign_id = unsubscribes_xf.campaign_id\n\n)\n\nselect * \nfrom metrics_xf", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp.int_mailchimp__campaign_activities_by_email", "model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__campaign_recipients"], "unique_id": "model.mailchimp.mailchimp__campaign_recipients", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__campaign_recipients.sql", "original_file_path": "models/mailchimp__campaign_recipients.sql", "name": "mailchimp__campaign_recipients", "alias": "mailchimp__campaign_recipients", "checksum": {"name": "sha256", "checksum": "f21d83f3c0ee06ea700fb656944f42bbfc9eaa6471e18d42c7e79563d49cf319"}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients"], ["int_mailchimp__campaign_activities_by_email"], ["stg_mailchimp__unsubscribes"], ["stg_mailchimp__campaigns"]], "sources": [], "description": "Each record represents the send of a campaign email, enriched with click, open and unsubscribe metrics.", "columns": {"email_id": {"name": "email_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the segment the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "was_opened": {"name": "was_opened", "description": "Whether the email sent was opened.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "was_clicked": {"name": "was_clicked", "description": "Whether the email sent was clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_open_timestamp": {"name": "first_open_timestamp", "description": "The timestamp of the first open for an email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_to_open_minutes": {"name": "time_to_open_minutes", "description": "The time from send to open in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_to_open_hours": {"name": "time_to_open_hours", "description": "The time from send to open in hours.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_to_open_days": {"name": "time_to_open_days", "description": "The time from send to open in days.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "was_unsubscribed": {"name": "was_unsubscribed", "description": "Whether the user unsubscribed via the sent email.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__campaign_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1634918964, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_email as (\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans\n),recipients as (\n \n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_email\n\n), unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), campaigns as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\n\n), joined as (\n\n select \n recipients.*,\n campaigns.segment_id,\n campaigns.send_timestamp\n from recipients\n left join campaigns\n on recipients.campaign_id = campaigns.campaign_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.was_opened, False) as was_opened,\n coalesce(activities.was_clicked, False) as was_clicked,\n activities.first_open_timestamp,\n activities.time_to_open_minutes,\n activities.time_to_open_hours,\n activities.time_to_open_days\n from joined\n left join activities\n on joined.email_id = activities.email_id\n\n), unsubscribes_xf as (\n\n select \n member_id,\n campaign_id\n from unsubscribes\n group by 1,2\n\n), metrics_xf as (\n\n select \n metrics.*,\n case when unsubscribes_xf.member_id is not null then True else False end as was_unsubscribed\n from metrics\n left join unsubscribes_xf\n on metrics.member_id = unsubscribes_xf.member_id\n and metrics.campaign_id = unsubscribes_xf.campaign_id\n\n)\n\nselect * \nfrom metrics_xf", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_email", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_email as (\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans\n)"}], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`"}, "model.mailchimp.mailchimp__automations": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith automations as (\n\n select *\n from {{ var('automation')}}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_automation') }}\n\n), joined as (\n\n select \n automations.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from automations\n left join activities\n on automations.automation_id = activities.automation_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp.int_mailchimp__automation_activities_by_automation"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__automations"], "unique_id": "model.mailchimp.mailchimp__automations", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__automations.sql", "original_file_path": "models/mailchimp__automations.sql", "name": "mailchimp__automations", "alias": "mailchimp__automations", "checksum": {"name": "sha256", "checksum": "f840bd0b805652fd09bb2d81f6f6afba0da4c21532b0331865c415407148debe"}, "tags": [], "refs": [["stg_mailchimp__automations"], ["int_mailchimp__automation_activities_by_automation"]], "sources": [], "description": "Each record represents an automation in Mailchimp, enriched with click, open and unsubscribe metrics. (Enabled if you are using automations.)", "columns": {"automation_id": {"name": "automation_id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sends": {"name": "sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unsubscribes": {"name": "unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__automations.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_automation as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined\n),automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_automation\n\n), joined as (\n\n select \n automations.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from automations\n left join activities\n on automations.automation_id = activities.automation_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_automation", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_automation as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__automations`"}, "model.mailchimp.mailchimp__automation_emails": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n emails.*,\n automations.list_id,\n automations.segment_id\n from emails\n left join automations\n on emails.automation_id = automations.automation_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.sends, 0) as sends,\n coalesce(activities.opens, 0) as opens,\n coalesce(activities.clicks, 0) as clicks,\n coalesce(activities.unique_opens, 0) as unique_opens,\n coalesce(activities.unique_clicks, 0) as unique_clicks,\n coalesce(activities.unsubscribes, 0) as unsubscribes\n from joined\n left join activities\n on joined.automation_email_id = activities.automation_email_id\n\n)\n\nselect * \nfrom metrics", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__automation_emails"], "unique_id": "model.mailchimp.mailchimp__automation_emails", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__automation_emails.sql", "original_file_path": "models/mailchimp__automation_emails.sql", "name": "mailchimp__automation_emails", "alias": "mailchimp__automation_emails", "checksum": {"name": "sha256", "checksum": "aaf2554526f64bec3baf3a9da0b280a42a10f4e9001b39cb9fda3091fdd0add5"}, "tags": [], "refs": [["stg_mailchimp__automation_emails"], ["int_mailchimp__automation_activities_by_email"], ["stg_mailchimp__automations"]], "sources": [], "description": "Each record represents an automation email (that make up automations), enriched with click, open and unsubscribe metrics. (Enabled if you are using automations.)", "columns": {"automation_email_id": {"name": "automation_email_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List this automation email is being sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment this automation email is being sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sends": {"name": "sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unsubscribes": {"name": "unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__automation_emails.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_email as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined\n),emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_email\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n emails.*,\n automations.list_id,\n automations.segment_id\n from emails\n left join automations\n on emails.automation_id = automations.automation_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.sends, 0) as sends,\n coalesce(activities.opens, 0) as opens,\n coalesce(activities.clicks, 0) as clicks,\n coalesce(activities.unique_opens, 0) as unique_opens,\n coalesce(activities.unique_clicks, 0) as unique_clicks,\n coalesce(activities.unsubscribes, 0) as unsubscribes\n from joined\n left join activities\n on joined.automation_email_id = activities.automation_email_id\n\n)\n\nselect * \nfrom metrics", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_email", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_email as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_emails`"}, "model.mailchimp.mailchimp__segments": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith segments as (\n\n select *\n from {{ var('mailchimp_segment')}}\n\n), campaign_activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_segment') }}\n\n), lists as (\n\n select *\n from {{ var('list')}}\n\n), metrics as (\n\n select \n segments.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes,\n lists.name as list_name\n\n from segments\n left join campaign_activities\n on segments.segment_id = campaign_activities.segment_id\n left join lists \n on segments.list_id = lists.list_id\n\n{% if var('mailchimp_using_automations', True) %}\n\n), automation_activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_segment') }}\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.segment_id = automation_activities.segment_id\n\n)\n\nselect *\nfrom metrics_xf\n\n{% else %}\n\n)\n\nselect *\nfrom metrics \n\n{% endif %}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__segments", "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp.int_mailchimp__automation_activities_by_segment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__segments"], "unique_id": "model.mailchimp.mailchimp__segments", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp__segments.sql", "original_file_path": "models/mailchimp__segments.sql", "name": "mailchimp__segments", "alias": "mailchimp__segments", "checksum": {"name": "sha256", "checksum": "c15c826314f1107b79343a2d65e537b4413a3206773c1f4a841768a124647585"}, "tags": [], "refs": [["stg_mailchimp__segments"], ["int_mailchimp__campaign_activities_by_segment"], ["stg_mailchimp__lists"], ["int_mailchimp__automation_activities_by_segment"]], "sources": [], "description": "Each record represents a segment in Mailchimp, enriched with campaign metrics and (optionally) automation metrics. (Enabled if you are using segments.)", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_name": {"name": "list_name", "description": "The name of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_name": {"name": "segment_name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_type": {"name": "segment_type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_sends": {"name": "campaign_sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_opens": {"name": "campaign_opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_clicks": {"name": "campaign_clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_opens": {"name": "campaign_unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_clicks": {"name": "campaign_unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unsubscribes": {"name": "campaign_unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_sends": {"name": "automation_sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_opens": {"name": "automation_opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_clicks": {"name": "automation_clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_opens": {"name": "automation_unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_clicks": {"name": "automation_unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unsubscribes": {"name": "automation_unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__segments.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1634918964, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__campaign_activities_by_segment as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted\n), __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_segment as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined\n),segments as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\n\n), campaign_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_segment\n\n), lists as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\n\n), metrics as (\n\n select \n segments.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes,\n lists.name as list_name\n\n from segments\n left join campaign_activities\n on segments.segment_id = campaign_activities.segment_id\n left join lists \n on segments.list_id = lists.list_id\n\n\n\n), automation_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_segment\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.segment_id = automation_activities.segment_id\n\n)\n\nselect *\nfrom metrics_xf\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_segment as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_segment", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_segment as (\n\n\nwith activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`bigquery`.`dbt_renee_mailchimp`.`mailchimp__segments`"}, "model.mailchimp.int_mailchimp__automation_activities_by_member": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_member"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_member", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_member.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_member.sql", "name": "int_mailchimp__automation_activities_by_member", "alias": "int_mailchimp__automation_activities_by_member", "checksum": {"name": "sha256", "checksum": "38ab3ac9ce7da18dff1e2c43677fb7c92abbfe0146cb192790097aefcadbce53"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_member.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__members_by_list": {"raw_sql": "with members as (\n\n select *\n from {{ ref('mailchimp__members') }}\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__members"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__members_by_list"], "unique_id": "model.mailchimp.int_mailchimp__members_by_list", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__members_by_list.sql", "original_file_path": "models/intermediate/int_mailchimp__members_by_list.sql", "name": "int_mailchimp__members_by_list", "alias": "int_mailchimp__members_by_list", "checksum": {"name": "sha256", "checksum": "24d58444ec10913bf4231cc95d22748734e620e0553935cb44c8c2d0eeb1dadc"}, "tags": [], "refs": [["mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__members_by_list.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1634918963, "compiled_sql": "with members as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__members`\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_list": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_list"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_list", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_list.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_list.sql", "name": "int_mailchimp__automation_activities_by_list", "alias": "int_mailchimp__automation_activities_by_list", "checksum": {"name": "sha256", "checksum": "5f71eb8826497fb24a723727df3b704c25a247718c5cc490ef89b56db68460ac"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_list.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_list": {"raw_sql": "with recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_list"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_list", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_list.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_list.sql", "name": "int_mailchimp__campaign_activities_by_list", "alias": "int_mailchimp__campaign_activities_by_list", "checksum": {"name": "sha256", "checksum": "60daae7c38b56f8e7c56af7e9cff177fb5ee9da88ab8e68fa16567c7f0abcfdc"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_list.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1634918963, "compiled_sql": "with recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_member": {"raw_sql": "with recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_member"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_member", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_member.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_member.sql", "name": "int_mailchimp__campaign_activities_by_member", "alias": "int_mailchimp__campaign_activities_by_member", "checksum": {"name": "sha256", "checksum": "0489310b8f640f0845c4ad9c02f3cef04463259abab6188dce74cc5a84fbe7d7"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_member.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1634918963, "compiled_sql": "with recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_segment": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_segment"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_segment.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_segment.sql", "name": "int_mailchimp__campaign_activities_by_segment", "alias": "int_mailchimp__campaign_activities_by_segment", "checksum": {"name": "sha256", "checksum": "16906edebc87c9092d1e7f5a45ce744e192f1327225f3fc669cad50a157f773b"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_segment.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_automation": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_automation"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_automation", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_automation.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_automation.sql", "name": "int_mailchimp__automation_activities_by_automation", "alias": "int_mailchimp__automation_activities_by_automation", "checksum": {"name": "sha256", "checksum": "8665b30393103b13f4afbe97ac787686b6c8152e3ac99551a1eb6375ced4323d"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_automation.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_email": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_email"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_email", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_email.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_email.sql", "name": "int_mailchimp__automation_activities_by_email", "alias": "int_mailchimp__automation_activities_by_email", "checksum": {"name": "sha256", "checksum": "b04d6d481f7834458dfca27b206c9ee852fc2c5db8b43c105ac8e3fe792df57e"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_email.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_unsubscribes": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith unsubscribes as (\n\n select *\n from {{ var('unsubscribe') }}\n\n), automation_emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_unsubscribes"], "unique_id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__automation_unsubscribes.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_unsubscribes.sql", "name": "int_mailchimp__automation_unsubscribes", "alias": "int_mailchimp__automation_unsubscribes", "checksum": {"name": "sha256", "checksum": "4d8a69f68951c9ee8f4662ba7a68b7335905622b2c8ed2fe05d29a106a60df29"}, "tags": [], "refs": [["stg_mailchimp__unsubscribes"], ["stg_mailchimp__automation_emails"], ["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_unsubscribes.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_campaign": {"raw_sql": "with recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_campaign"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_campaign.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_campaign.sql", "name": "int_mailchimp__campaign_activities_by_campaign", "alias": "int_mailchimp__campaign_activities_by_campaign", "checksum": {"name": "sha256", "checksum": "d62ab7383aa326b7471819dbc384d6bbf6f4cce9d54985cdabd6c1847e6142cb"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_campaign.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1634918963, "compiled_sql": "with recipients as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_recipients": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith recipients as (\n\n select *\n from {{ var('automation_recipient') }}\n\n), automation_emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_recipients"], "unique_id": "model.mailchimp.int_mailchimp__automation_recipients", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__automation_recipients.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_recipients.sql", "name": "int_mailchimp__automation_recipients", "alias": "int_mailchimp__automation_recipients", "checksum": {"name": "sha256", "checksum": "1aa76bbe079c311f1e0d3282e626f9bd32afcd22ca8870ff40116541c6ab264a"}, "tags": [], "refs": [["stg_mailchimp__automation_recipients"], ["stg_mailchimp__automation_emails"], ["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_segment": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_segment"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_segment", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_segment.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_segment.sql", "name": "int_mailchimp__automation_activities_by_segment", "alias": "int_mailchimp__automation_activities_by_segment", "checksum": {"name": "sha256", "checksum": "82a7ae9769543e2832a0b6436842cfa6298028bcfc8320027855171e21b15cdc"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_segment.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1634918963, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_email": {"raw_sql": "with activities as (\n\n select *\n from {{ ref('mailchimp__campaign_activities')}}\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_activities"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_email"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_email", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_email.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_email.sql", "name": "int_mailchimp__campaign_activities_by_email", "alias": "int_mailchimp__campaign_activities_by_email", "checksum": {"name": "sha256", "checksum": "02daffaef1924ed64cf15f7775e89262fc2e7435549c94b5d86b1fef5ceb099b"}, "tags": [], "refs": [["mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_email.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1634918963, "compiled_sql": "with activities as (\n\n select *\n from `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_activities') }} where {{config.get('where')}}) stg_mailchimp__automation_activities{% else %}{{ ref('stg_mailchimp__automation_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_activities_activity_id", "alias": "not_null_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_activities') }} where {{config.get('where')}}) stg_mailchimp__automation_activities{% else %}{{ ref('stg_mailchimp__automation_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_activities_activity_id", "alias": "unique_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_emails') }} where {{config.get('where')}}) stg_mailchimp__automation_emails{% else %}{{ ref('stg_mailchimp__automation_emails') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_emails_automation_email_id", "alias": "unique_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n automation_email_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\nwhere automation_email_id is not null\ngroup by automation_email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_emails') }} where {{config.get('where')}}) stg_mailchimp__automation_emails{% else %}{{ ref('stg_mailchimp__automation_emails') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_emails_automation_email_id", "alias": "not_null_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\nwhere automation_email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}{{ config(alias=\"not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154\") }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_recipient_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_recipients') }} where {{config.get('where')}}) stg_mailchimp__automation_recipients{% else %}{{ ref('stg_mailchimp__automation_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154"}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\nwhere automation_recipient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id"}, "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}{{ config(alias=\"unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db\") }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_recipient_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_recipients') }} where {{config.get('where')}}) stg_mailchimp__automation_recipients{% else %}{{ ref('stg_mailchimp__automation_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db"}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n automation_recipient_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\nwhere automation_recipient_id is not null\ngroup by automation_recipient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id"}, "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automations') }} where {{config.get('where')}}) stg_mailchimp__automations{% else %}{{ ref('stg_mailchimp__automations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automations_automation_id", "alias": "unique_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n automation_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\nwhere automation_id is not null\ngroup by automation_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id"}, "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automations') }} where {{config.get('where')}}) stg_mailchimp__automations{% else %}{{ ref('stg_mailchimp__automations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automations_automation_id", "alias": "not_null_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\nwhere automation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_recipients') }} where {{config.get('where')}}) stg_mailchimp__campaign_recipients{% else %}{{ ref('stg_mailchimp__campaign_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_recipients_email_id", "alias": "unique_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n email_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\nwhere email_id is not null\ngroup by email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_recipients') }} where {{config.get('where')}}) stg_mailchimp__campaign_recipients{% else %}{{ ref('stg_mailchimp__campaign_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_recipients_email_id", "alias": "not_null_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\nwhere email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_activities') }} where {{config.get('where')}}) stg_mailchimp__campaign_activities{% else %}{{ ref('stg_mailchimp__campaign_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_activities_activity_id", "alias": "unique_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_activities') }} where {{config.get('where')}}) stg_mailchimp__campaign_activities{% else %}{{ ref('stg_mailchimp__campaign_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_activities_activity_id", "alias": "not_null_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaigns') }} where {{config.get('where')}}) stg_mailchimp__campaigns{% else %}{{ ref('stg_mailchimp__campaigns') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaigns_campaign_id", "alias": "unique_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n campaign_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\nwhere campaign_id is not null\ngroup by campaign_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id"}, "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaigns') }} where {{config.get('where')}}) stg_mailchimp__campaigns{% else %}{{ ref('stg_mailchimp__campaigns') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaigns_campaign_id", "alias": "not_null_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id"}, "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "list_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__lists') }} where {{config.get('where')}}) stg_mailchimp__lists{% else %}{{ ref('stg_mailchimp__lists') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__lists_list_id", "alias": "unique_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n list_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\nwhere list_id is not null\ngroup by list_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id"}, "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__lists') }} where {{config.get('where')}}) stg_mailchimp__lists{% else %}{{ ref('stg_mailchimp__lists') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__lists_list_id", "alias": "not_null_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id"}, "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "member_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__members') }} where {{config.get('where')}}) stg_mailchimp__members{% else %}{{ ref('stg_mailchimp__members') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__members_member_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__members_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__members_member_id", "alias": "unique_stg_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n member_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\nwhere member_id is not null\ngroup by member_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id"}, "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "member_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__members') }} where {{config.get('where')}}) stg_mailchimp__members{% else %}{{ ref('stg_mailchimp__members') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__members_member_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__members_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__members_member_id", "alias": "not_null_stg_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\nwhere member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id"}, "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "segment_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__segments') }} where {{config.get('where')}}) stg_mailchimp__segments{% else %}{{ ref('stg_mailchimp__segments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__segments_segment_id", "alias": "unique_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n segment_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\nwhere segment_id is not null\ngroup by segment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id"}, "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "segment_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__segments') }} where {{config.get('where')}}) stg_mailchimp__segments{% else %}{{ ref('stg_mailchimp__segments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__segments_segment_id", "alias": "not_null_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\nwhere segment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id"}, "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unsubscribe_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__unsubscribes') }} where {{config.get('where')}}) stg_mailchimp__unsubscribes{% else %}{{ ref('stg_mailchimp__unsubscribes') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\nwhere unsubscribe_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id"}, "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unsubscribe_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__unsubscribes') }} where {{config.get('where')}}) stg_mailchimp__unsubscribes{% else %}{{ ref('stg_mailchimp__unsubscribes') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n unsubscribe_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\nwhere unsubscribe_id is not null\ngroup by unsubscribe_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id"}, "test.mailchimp.unique_mailchimp__lists_list_id.ac74445e11": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "list_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__lists') }} where {{config.get('where')}}) mailchimp__lists{% else %}{{ ref('mailchimp__lists') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__lists"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__lists_list_id"], "unique_id": "test.mailchimp.unique_mailchimp__lists_list_id.ac74445e11", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__lists_list_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__lists_list_id", "alias": "unique_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n list_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__lists`\nwhere list_id is not null\ngroup by list_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id"}, "test.mailchimp.not_null_mailchimp__lists_list_id.3b19bed371": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__lists') }} where {{config.get('where')}}) mailchimp__lists{% else %}{{ ref('mailchimp__lists') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__lists"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__lists_list_id"], "unique_id": "test.mailchimp.not_null_mailchimp__lists_list_id.3b19bed371", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__lists_list_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__lists_list_id", "alias": "not_null_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__lists`\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id"}, "test.mailchimp.unique_mailchimp__members_member_id.cf802ea62a": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "member_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__members') }} where {{config.get('where')}}) mailchimp__members{% else %}{{ ref('mailchimp__members') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__members"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__members_member_id"], "unique_id": "test.mailchimp.unique_mailchimp__members_member_id.cf802ea62a", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__members_member_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__members_member_id", "alias": "unique_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n member_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__members`\nwhere member_id is not null\ngroup by member_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id"}, "test.mailchimp.not_null_mailchimp__members_member_id.b3d42f42f5": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "member_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__members') }} where {{config.get('where')}}) mailchimp__members{% else %}{{ ref('mailchimp__members') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__members"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__members_member_id"], "unique_id": "test.mailchimp.not_null_mailchimp__members_member_id.b3d42f42f5", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__members_member_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__members_member_id", "alias": "not_null_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__members`\nwhere member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id"}, "test.mailchimp.unique_mailchimp__campaigns_campaign_id.17cc6ca14f": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__campaigns') }} where {{config.get('where')}}) mailchimp__campaigns{% else %}{{ ref('mailchimp__campaigns') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp.unique_mailchimp__campaigns_campaign_id.17cc6ca14f", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__campaigns_campaign_id", "alias": "unique_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n campaign_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaigns`\nwhere campaign_id is not null\ngroup by campaign_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id"}, "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.b2a5bb0c67": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__campaigns') }} where {{config.get('where')}}) mailchimp__campaigns{% else %}{{ ref('mailchimp__campaigns') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.b2a5bb0c67", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__campaigns_campaign_id", "alias": "not_null_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaigns`\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id"}, "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.638c4769d4": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "email_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__campaign_recipients') }} where {{config.get('where')}}) mailchimp__campaign_recipients{% else %}{{ ref('mailchimp__campaign_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.638c4769d4", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__campaign_recipients_email_id", "alias": "unique_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n email_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\nwhere email_id is not null\ngroup by email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id"}, "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.3af4b3f655": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__campaign_recipients') }} where {{config.get('where')}}) mailchimp__campaign_recipients{% else %}{{ ref('mailchimp__campaign_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.3af4b3f655", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__campaign_recipients_email_id", "alias": "not_null_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\nwhere email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id"}, "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.28bf1e5fbd": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__campaign_activities') }} where {{config.get('where')}}) mailchimp__campaign_activities{% else %}{{ ref('mailchimp__campaign_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__campaign_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.28bf1e5fbd", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__campaign_activities_activity_id", "alias": "unique_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.f493ad0b31": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__campaign_activities') }} where {{config.get('where')}}) mailchimp__campaign_activities{% else %}{{ ref('mailchimp__campaign_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__campaign_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.f493ad0b31", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__campaign_activities_activity_id", "alias": "not_null_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp.unique_mailchimp__automations_automation_id.027f8f6fb3": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__automations') }} where {{config.get('where')}}) mailchimp__automations{% else %}{{ ref('mailchimp__automations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__automations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp.unique_mailchimp__automations_automation_id.027f8f6fb3", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__automations_automation_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__automations_automation_id", "alias": "unique_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n automation_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automations`\nwhere automation_id is not null\ngroup by automation_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id"}, "test.mailchimp.not_null_mailchimp__automations_automation_id.c6a95d5564": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__automations') }} where {{config.get('where')}}) mailchimp__automations{% else %}{{ ref('mailchimp__automations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__automations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp.not_null_mailchimp__automations_automation_id.c6a95d5564", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__automations_automation_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__automations_automation_id", "alias": "not_null_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automations`\nwhere automation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id"}, "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.218a63b754": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_email_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__automation_emails') }} where {{config.get('where')}}) mailchimp__automation_emails{% else %}{{ ref('mailchimp__automation_emails') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__automation_emails"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.218a63b754", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__automation_emails_automation_email_id", "alias": "unique_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n automation_email_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_emails`\nwhere automation_email_id is not null\ngroup by automation_email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id"}, "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.044b815e20": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_email_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__automation_emails') }} where {{config.get('where')}}) mailchimp__automation_emails{% else %}{{ ref('mailchimp__automation_emails') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__automation_emails"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.044b815e20", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__automation_emails_automation_email_id", "alias": "not_null_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_emails`\nwhere automation_email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id"}, "test.mailchimp.unique_mailchimp__automation_activities_activity_id.028a855f2c": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__automation_activities') }} where {{config.get('where')}}) mailchimp__automation_activities{% else %}{{ ref('mailchimp__automation_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__automation_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp.unique_mailchimp__automation_activities_activity_id.028a855f2c", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__automation_activities_activity_id", "alias": "unique_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.69f7ec2ea4": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__automation_activities') }} where {{config.get('where')}}) mailchimp__automation_activities{% else %}{{ ref('mailchimp__automation_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__automation_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.69f7ec2ea4", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__automation_activities_activity_id", "alias": "not_null_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp.unique_mailchimp__segments_segment_id.6fa54c3e6f": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "segment_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__segments') }} where {{config.get('where')}}) mailchimp__segments{% else %}{{ ref('mailchimp__segments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp.mailchimp__segments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "unique_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp.unique_mailchimp__segments_segment_id.6fa54c3e6f", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/unique_mailchimp__segments_segment_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__segments_segment_id", "alias": "unique_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/unique_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect\n segment_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__segments`\nwhere segment_id is not null\ngroup by segment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id"}, "test.mailchimp.not_null_mailchimp__segments_segment_id.1b04ffa743": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "segment_id", "model": "{% if config.get('where') %}(select * from {{ ref('mailchimp__segments') }} where {{config.get('where')}}) mailchimp__segments{% else %}{{ ref('mailchimp__segments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp.mailchimp__segments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "schema_test", "not_null_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp.not_null_mailchimp__segments_segment_id.1b04ffa743", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "schema_test/not_null_mailchimp__segments_segment_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__segments_segment_id", "alias": "not_null_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/schema_test/not_null_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918964, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_mailchimp`.`mailchimp__segments`\nwhere segment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id"}}, "sources": {"source.mailchimp_source.mailchimp.automation": {"fqn": ["mailchimp_source", "mailchimp", "automation"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.automation_email": {"fqn": ["mailchimp_source", "mailchimp", "automation_email"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_email", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_email", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_email", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation email (that make up automations).", "columns": {"id": {"name": "id", "description": "The ID of the email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation_email`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.automation_recipient": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents info about the recipient of each automation.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation_recipient`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.automation_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient_activity"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation_recipient_activity`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.campaign": {"fqn": ["mailchimp_source", "mailchimp", "campaign"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a campaign in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`campaign`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.campaign_recipient": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents the send of a campaign email.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`campaign_recipient`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient_activity"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`campaign_recipient_activity`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.segment": {"fqn": ["mailchimp_source", "mailchimp", "segment"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.segment", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a segment in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`segment`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.segment_member": {"fqn": ["mailchimp_source", "mailchimp", "segment_member"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.segment_member", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment_member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment_member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member and their segment data.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`segment_member`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.list": {"fqn": ["mailchimp_source", "mailchimp", "list"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.list", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "list", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "list", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a list in Mailchimp.", "columns": {"id": {"name": "id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`list`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.member": {"fqn": ["mailchimp_source", "mailchimp", "member"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.member", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member in Mailchimp. Note that this table may contain custom metadata columns which can be passed through via `mailchimp__members_pass_through_columns`.\n", "columns": {"id": {"name": "id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_signup": {"name": "timestamp_signup", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_opt": {"name": "timestamp_opt", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed": {"name": "last_changed", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_opt": {"name": "ip_opt", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_signup": {"name": "ip_signup", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`member`", "created_at": 1634918964}, "source.mailchimp_source.mailchimp.unsubscribe": {"fqn": ["mailchimp_source", "mailchimp", "unsubscribe"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.unsubscribe", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "unsubscribe", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "unsubscribe", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member who unsubscribed.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`unsubscribe`", "created_at": 1634918964}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_table_options(config, model, temporary=false) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view(run_outside_transaction_hooks=False) %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.make_date_partitioned_table": {"unique_id": "macro.dbt_bigquery.make_date_partitioned_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "make_date_partitioned_table", "macro_sql": "{% macro make_date_partitioned_table(model, relation, dates, should_create, verbose=False) %}\n\n {% if should_create %}\n {{ adapter.make_date_partitioned_table(relation) }}\n {% endif %}\n\n {% for date in dates %}\n {% set date = (date | string) %}\n {% if verbose %}\n {% set table_start_time = modules.datetime.datetime.now().strftime(\"%H:%M:%S\") %}\n {{ log(table_start_time ~ ' | -> Running for day ' ~ date, info=True) }}\n {% endif %}\n\n {% set fixed_sql = model['compiled_sql'] | replace('[DBT__PARTITION_DATE]', date) %}\n {% set _ = adapter.execute_model(model, 'table', fixed_sql, decorator=date) %}\n {% endfor %}\n\n {% set num_days = dates | length %}\n {% if num_days == 1 %}\n {% set result_str = 'CREATED 1 PARTITION' %}\n {% else %}\n {% set result_str = 'CREATED ' ~ num_days ~ ' PARTITIONS' %}\n {% endif %}\n\n {{ store_result('main', response=result_str) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n {%- set verbose = config.get('verbose', False) -%}\n\n {# partitions: iterate over each partition, running a separate query in a for-loop #}\n {%- set partitions = config.get('partitions') -%}\n\n {% if partitions %}\n {% if partitions is number or partitions is string %}\n {% set partitions = [(partitions | string)] %}\n {% endif %}\n\n {% if partitions is not iterable %}\n {{ exceptions.raise_compiler_error(\"Provided `partitions` configuration is not a list. Got: \" ~ partitions, model) }}\n {% endif %}\n {% endif %}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n Since dbt uses WRITE_TRUNCATE mode for tables, we only need to drop this thing\n if it is not a table. If it _is_ already a table, then we can overwrite it without downtime\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {% if partitions %}\n {# Create the dp-table if 1. it does not exist or 2. it existed, but we just dropped it #}\n {%- set should_create = (old_relation is none or exists_not_as_table) -%}\n {{ make_date_partitioned_table(model, target_relation, partitions, should_create, verbose) }}\n {% else %}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt_bigquery.make_date_partitioned_table", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {# there should be exactly one ref or exactly one source #}\n {% set destination = this.incorporate(type='table') %}\n\n {% set dependency_type = none %}\n {% if (model.refs | length) == 1 and (model.sources | length) == 0 %}\n {% set dependency_type = 'ref' %}\n {% elif (model.refs | length) == 0 and (model.sources | length) == 1 %}\n {% set dependency_type = 'source' %}\n {% else %}\n {% set msg %}\n Expected exactly one ref or exactly one source, instead got {{ model.refs | length }} models and {{ model.sources | length }} sources.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% if dependency_type == 'ref' %}\n {% set src = ref(*model.refs[0]) %}\n {% else %}\n {% set src = source(*model.sources[0]) %}\n {% endif %}\n\n {%- set result_str = adapter.copy_table(\n src,\n destination,\n config.get('copy_materialization', 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% else %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation,\n target_relation,\n sql,\n unique_key,\n partition_by,\n partitions,\n dest_columns) %}\n\n {% else %}\n {#-- wrap sql in parens to make it a subquery --#}\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.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')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "materialization_test_default", "macro_sql": "\n\n{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.column_list": {"unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.column_list_for_create_table": {"unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n ;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/fishtown-analytics/dbt/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\n {%- set ns = namespace() -%} {# handle for-loop scoping with a namespace #}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = config.get('updated_at', snapshot_string_as_time(now)) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_sql']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.basic_load_csv_rows": {"unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "basic_load_csv_rows", "macro_sql": "{% macro basic_load_csv_rows(model, batch_size, agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n %s\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_seed_column_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.basic_load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.incremental_upsert": {"unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or should_full_refresh() %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% do adapter.drop_relation(intermediate_relation) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.should_full_refresh", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.incremental_upsert", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.common_get_delete_insert_merge_sql": {"unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.common_get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"old_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', macro_namespace = 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, 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 1\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_automation_recipient_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_recipient_columns.sql", "original_file_path": "macros/get_automation_recipient_columns.sql", "name": "get_automation_recipient_columns", "macro_sql": "{% macro get_automation_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_campaign_columns": {"unique_id": "macro.mailchimp_source.get_campaign_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_campaign_columns.sql", "original_file_path": "macros/get_campaign_columns.sql", "name": "get_campaign_columns", "macro_sql": "{% macro get_campaign_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"clicktale\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"content_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"long_archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reply_to\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"send_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"test_size\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timewarp\", \"datatype\": \"boolean\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_conversation\", \"datatype\": \"boolean\"},\n {\"name\": \"wait_time\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winner_criteria\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winning_campaign_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winning_combination_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_list_columns": {"unique_id": "macro.mailchimp_source.get_list_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_list_columns.sql", "original_file_path": "macros/get_list_columns.sql", "name": "get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"beamer_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_address_2\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"contact_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_created\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"default_from_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_language\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_subject\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"email_type_option\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_rating\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"notify_on_subscribe\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"notify_on_unsubscribe\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"permission_reminder\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscribe_url_long\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscribe_url_short\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_archive_bar\", \"datatype\": \"boolean\"},\n {\"name\": \"visibility\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_segment_columns": {"unique_id": "macro.mailchimp_source.get_segment_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_segment_columns.sql", "original_file_path": "macros/get_segment_columns.sql", "name": "get_segment_columns", "macro_sql": "{% macro get_segment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_count\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_automation_email_columns": {"unique_id": "macro.mailchimp_source.get_automation_email_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_email_columns.sql", "original_file_path": "macros/get_automation_email_columns.sql", "name": "get_automation_email_columns", "macro_sql": "{% macro get_automation_email_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"automation_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"clicktale\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"content_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"delay_action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_action_description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_amount\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"delay_direction\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"delay_full_description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"position\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"reply_to\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"send_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"start_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timewarp\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"use_conversation\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_member_columns": {"unique_id": "macro.mailchimp_source.get_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_member_columns.sql", "original_file_path": "macros/get_member_columns.sql", "name": "get_member_columns", "macro_sql": "{% macro get_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"dstoff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"email_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_client\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"gmtoff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ip_opt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ip_signup\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"language\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"last_changed\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"latitude\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"longitude\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"member_rating\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp_opt\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"timestamp_signup\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"timezone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unique_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vip\", \"datatype\": \"boolean\"}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('mailchimp__members_pass_through_columns')) }}\n\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float", "macro.dbt_utils.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_automation_columns": {"unique_id": "macro.mailchimp_source.get_automation_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_columns.sql", "original_file_path": "macros/get_automation_columns.sql", "name": "get_automation_columns", "macro_sql": "{% macro get_automation_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"start_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"trigger_settings\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_campaign_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_campaign_recipient_activity_columns.sql", "original_file_path": "macros/get_campaign_recipient_activity_columns.sql", "name": "get_campaign_recipient_activity_columns", "macro_sql": "{% macro get_campaign_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_campaign_recipient_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_campaign_recipient_columns.sql", "original_file_path": "macros/get_campaign_recipient_columns.sql", "name": "get_campaign_recipient_columns", "macro_sql": "{% macro get_campaign_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_unsubscribe_columns": {"unique_id": "macro.mailchimp_source.get_unsubscribe_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_unsubscribe_columns.sql", "original_file_path": "macros/get_unsubscribe_columns.sql", "name": "get_unsubscribe_columns", "macro_sql": "{% macro get_unsubscribe_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_segment_member_columns": {"unique_id": "macro.mailchimp_source.get_segment_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_segment_member_columns.sql", "original_file_path": "macros/get_segment_member_columns.sql", "name": "get_segment_member_columns", "macro_sql": "{% macro get_segment_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.mailchimp_source.get_automation_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_recipient_activity_columns.sql", "original_file_path": "macros/get_automation_recipient_activity_columns.sql", "name": "get_automation_recipient_activity_columns", "macro_sql": "{% macro get_automation_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) %}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.default__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.redshift__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.redshift__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918961}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.materialization_insert_by_period_default": {"unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed = \n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n \n-%}\n\n \n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n \n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt_utils.position", "macro.dbt_utils.split_part", "macro.dbt_utils.right", "macro.dbt_utils.length", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model) %}\n\n{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}\n\nwith a as (\n\n select count(*) as count_our_model from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparison_model from {{ compare_model }}\n\n),\ncounts as (\n\n select\n count_our_model,\n count_comparison_model\n from a\n cross join b\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'coalesce(diff_count, 0)') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n from a\n cross join b\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval) %}\n\n{% set threshold = dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp()) %}\n\nwith recency as (\n\n select max({{field}}) as most_recent\n from {{ model }}\n\n)\n\nselect\n\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name) %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name) %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n *\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\nwith validation as (\n select\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n),\nvalidation_errors as (\n select\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as previous_{{ column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = previous_{{ column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_not_null_where": {"unique_id": "macro.dbt_utils.default__test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, * from a_minus_b\n union all\n select 'b_minus_a' as which_diff, * from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', 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 }},\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.datediff(start_date, end_date, datepart)}}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\n\n*/\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt_utils.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.type_string", "macro.dbt_utils.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\n\n {%- set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- set _ = fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.hash", "macro.dbt_utils.concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as table_type\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set target_relation = adapter.get_relation(database=table.database,\n schema=table.schema,\n identifier=table.identifier) -%}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not target_relation and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ table ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not target_relation and default is not none -%}\n\n {{ log(\"Relation \" ~ table ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for v in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ v ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.generate_columns_macro": {"unique_id": "macro.fivetran_utils.generate_columns_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/generate_columns_macro.sql", "original_file_path": "macros/generate_columns_macro.sql", "name": "generate_columns_macro", "macro_sql": "{% macro generate_columns_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set columns = get_columns_for_macro(table_name, schema_name, database_name) %}\n\n{% set jinja_macro=[] %}\n\n{% do jinja_macro.append('{% macro get_' ~ table_name ~ '_columns() %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% set columns = [') %}\n\n{% for col in columns %}\n{% do jinja_macro.append(' ' ~ col ~ (',' if not loop.last)) %}\n{% endfor %}\n\n{% do jinja_macro.append('] %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{{ return(columns) }}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% endmacro %}') %}\n\n{% if execute %}\n\n {% set joined = jinja_macro | join ('\\n') %}\n {{ log(joined, info=True) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation() -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') () }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation() %}\n\n{% if var('union_schemas', none) %}\n, case\n {% for schema in var('union_schemas') %}\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_databases', none) %}\n, case\n {% for database in var('union_databases') %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, '' as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.staging_models_automation": {"unique_id": "macro.fivetran_utils.staging_models_automation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/staging_models_automation.sql", "original_file_path": "macros/staging_models_automation.sql", "name": "staging_models_automation", "macro_sql": "{% macro staging_models_automation(package, source_schema, source_database, tables) %}\n\n{% set package = \"\"~ package ~\"\" %}\n{% set source_schema = \"\"~ source_schema ~\"\" %}\n{% set source_database = \"\"~ source_database ~\"\" %}\n\n{% set zsh_command = \"source dbt_modules/fivetran_utils/columns_setup.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n\n{% for t in tables %}\n {% if t != tables[-1] %}\n {% set help_command = zsh_command + t + \" && \\n\" %}\n\n {% else %}\n {% set help_command = zsh_command + t %}\n\n {% endif %}\n {{ log(help_command, info=True) }}\n\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.default__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "default__get_columns_for_macro", "macro_sql": "{% macro default__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'text' then 'dbt_utils.type_string()' \n when lower(data_type) = 'boolean' then '\"boolean\"'\n when lower(data_type) = 'number' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float' then 'dbt_utils.type_float()' \n when lower(data_type) = 'date' then '\"date\"'\n end,\n '}')\nfrom {{ database_name }}.information_schema.columns\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.bigquery__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.bigquery__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "bigquery__get_columns_for_macro", "macro_sql": "{% macro bigquery__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'string' then 'dbt_utils.type_string()' \n when lower(data_type) = 'bool' then '\"boolean\"'\n when lower(data_type) = 'numeric' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float64' then 'dbt_utils.type_float()' \n when lower(data_type) = 'int64' then 'dbt_utils.type_int()' \n when lower(data_type) = 'date' then '\"date\"' \n when lower(data_type) = 'datetime' then '\"datetime\"' \n end,\n '}')\nfrom `{{ database_name }}`.{{ schema_name }}.INFORMATION_SCHEMA.COLUMNS\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.get_columns_for_macro": {"unique_id": "macro.fivetran_utils.get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "get_columns_for_macro", "macro_sql": "{% macro get_columns_for_macro(table_name, schema_name, database_name) -%}\n {{ return(adapter.dispatch('get_columns_for_macro')(table_name, schema_name, database_name)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/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 json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/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.name == source.name %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/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) -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) %}\n\n{% if var('union_schemas', none) %}\n\n {% set relations = [] %}\n\n {% if var('union_schemas') is string %}\n {% set trimmed = var('union_schemas')|trim('[')|trim(']')|trim('(')|trim(')') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var('union_schemas') %}\n {% endif %}\n\n {% for schema in schemas %}\n\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var('union_databases', none) %}\n\n {% set relations = [] %}\n\n {% for database in var('union_databases') %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918962}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--models` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}, "mailchimp.campaign_sends": {"unique_id": "mailchimp.campaign_sends", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_sends", "block_contents": "The number of sent emails from campaigns."}, "mailchimp.campaign_opens": {"unique_id": "mailchimp.campaign_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_opens", "block_contents": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric."}, "mailchimp.campaign_clicks": {"unique_id": "mailchimp.campaign_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_clicks", "block_contents": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric."}, "mailchimp.campaign_unique_opens": {"unique_id": "mailchimp.campaign_unique_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_unique_opens", "block_contents": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp."}, "mailchimp.campaign_unique_clicks": {"unique_id": "mailchimp.campaign_unique_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_unique_clicks", "block_contents": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp."}, "mailchimp.campaign_unsubscribes": {"unique_id": "mailchimp.campaign_unsubscribes", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_unsubscribes", "block_contents": "The number of users who have unsubscribed from campaign emails."}, "mailchimp.automation_sends": {"unique_id": "mailchimp.automation_sends", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_sends", "block_contents": "The number of sent emails from automations."}, "mailchimp.automation_opens": {"unique_id": "mailchimp.automation_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_opens", "block_contents": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric."}, "mailchimp.automation_clicks": {"unique_id": "mailchimp.automation_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_clicks", "block_contents": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric."}, "mailchimp.automation_unique_opens": {"unique_id": "mailchimp.automation_unique_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_unique_opens", "block_contents": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp."}, "mailchimp.automation_unique_clicks": {"unique_id": "mailchimp.automation_unique_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_unique_clicks", "block_contents": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp."}, "mailchimp.automation_unsubscribes": {"unique_id": "mailchimp.automation_unsubscribes", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_unsubscribes", "block_contents": "The number of users who have unsubscribed from automation emails."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"model.mailchimp_source.stg_mailchimp__segments": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__lists": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"], "model.mailchimp_source.stg_mailchimp__campaigns": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "model.mailchimp_source.stg_mailchimp__automations": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__members": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "model.mailchimp_source.stg_mailchimp__segment_members": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["source.mailchimp_source.mailchimp.automation_recipient_activity"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["source.mailchimp_source.mailchimp.unsubscribe"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["source.mailchimp_source.mailchimp.list"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["source.mailchimp_source.mailchimp.segment"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["source.mailchimp_source.mailchimp.campaign"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["source.mailchimp_source.mailchimp.segment_member"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["source.mailchimp_source.mailchimp.member"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["source.mailchimp_source.mailchimp.automation"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["source.mailchimp_source.mailchimp.automation_email"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["source.mailchimp_source.mailchimp.automation_recipient"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"], "model.mailchimp.mailchimp__automation_activities": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.mailchimp__lists": ["model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__campaign_activities_by_list", "model.mailchimp.int_mailchimp__members_by_list", "model.mailchimp_source.stg_mailchimp__lists"], "model.mailchimp.mailchimp__members": ["model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__campaign_activities_by_member", "model.mailchimp_source.stg_mailchimp__members"], "model.mailchimp.mailchimp__campaigns": ["model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp.mailchimp__campaign_activities": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp.mailchimp__campaign_recipients": ["model.mailchimp.int_mailchimp__campaign_activities_by_email", "model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp.mailchimp__automations": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.mailchimp__automation_emails": ["model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.mailchimp__segments": ["model.mailchimp.int_mailchimp__automation_activities_by_segment", "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp_source.stg_mailchimp__segments"], "model.mailchimp.int_mailchimp__automation_activities_by_member": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__members_by_list": ["model.mailchimp.mailchimp__members"], "model.mailchimp.int_mailchimp__automation_activities_by_list": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__campaign_activities_by_list": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__campaign_activities_by_member": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__campaign_activities_by_segment": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__automation_activities_by_automation": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__automation_activities_by_email": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__automation_unsubscribes": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp.int_mailchimp__campaign_activities_by_campaign": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__automation_recipients": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.int_mailchimp__automation_activities_by_segment": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__campaign_activities_by_email": ["model.mailchimp.mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "test.mailchimp.unique_mailchimp__lists_list_id.ac74445e11": ["model.mailchimp.mailchimp__lists"], "test.mailchimp.not_null_mailchimp__lists_list_id.3b19bed371": ["model.mailchimp.mailchimp__lists"], "test.mailchimp.unique_mailchimp__members_member_id.cf802ea62a": ["model.mailchimp.mailchimp__members"], "test.mailchimp.not_null_mailchimp__members_member_id.b3d42f42f5": ["model.mailchimp.mailchimp__members"], "test.mailchimp.unique_mailchimp__campaigns_campaign_id.17cc6ca14f": ["model.mailchimp.mailchimp__campaigns"], "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.b2a5bb0c67": ["model.mailchimp.mailchimp__campaigns"], "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.638c4769d4": ["model.mailchimp.mailchimp__campaign_recipients"], "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.3af4b3f655": ["model.mailchimp.mailchimp__campaign_recipients"], "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.28bf1e5fbd": ["model.mailchimp.mailchimp__campaign_activities"], "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.f493ad0b31": ["model.mailchimp.mailchimp__campaign_activities"], "test.mailchimp.unique_mailchimp__automations_automation_id.027f8f6fb3": ["model.mailchimp.mailchimp__automations"], "test.mailchimp.not_null_mailchimp__automations_automation_id.c6a95d5564": ["model.mailchimp.mailchimp__automations"], "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.218a63b754": ["model.mailchimp.mailchimp__automation_emails"], "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.044b815e20": ["model.mailchimp.mailchimp__automation_emails"], "test.mailchimp.unique_mailchimp__automation_activities_activity_id.028a855f2c": ["model.mailchimp.mailchimp__automation_activities"], "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.69f7ec2ea4": ["model.mailchimp.mailchimp__automation_activities"], "test.mailchimp.unique_mailchimp__segments_segment_id.6fa54c3e6f": ["model.mailchimp.mailchimp__segments"], "test.mailchimp.not_null_mailchimp__segments_segment_id.1b04ffa743": ["model.mailchimp.mailchimp__segments"], "source.mailchimp_source.mailchimp.automation": [], "source.mailchimp_source.mailchimp.automation_email": [], "source.mailchimp_source.mailchimp.automation_recipient": [], "source.mailchimp_source.mailchimp.automation_recipient_activity": [], "source.mailchimp_source.mailchimp.campaign": [], "source.mailchimp_source.mailchimp.campaign_recipient": [], "source.mailchimp_source.mailchimp.campaign_recipient_activity": [], "source.mailchimp_source.mailchimp.segment": [], "source.mailchimp_source.mailchimp.segment_member": [], "source.mailchimp_source.mailchimp.list": [], "source.mailchimp_source.mailchimp.member": [], "source.mailchimp_source.mailchimp.unsubscribe": []}, "child_map": {"model.mailchimp_source.stg_mailchimp__segments": ["model.mailchimp.mailchimp__segments", "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00", "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["model.mailchimp.mailchimp__campaign_recipients", "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6", "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa"], "model.mailchimp_source.stg_mailchimp__lists": ["model.mailchimp.mailchimp__lists", "model.mailchimp.mailchimp__segments", "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d", "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["model.mailchimp.mailchimp__automation_activities", "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67", "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__campaign_recipients", "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e", "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816"], "model.mailchimp_source.stg_mailchimp__campaigns": ["model.mailchimp.mailchimp__campaign_activities", "model.mailchimp.mailchimp__campaign_recipients", "model.mailchimp.mailchimp__campaigns", "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4", "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346"], "model.mailchimp_source.stg_mailchimp__automations": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities", "model.mailchimp.mailchimp__automation_emails", "model.mailchimp.mailchimp__automations", "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1", "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities", "model.mailchimp.mailchimp__automation_emails", "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84", "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["model.mailchimp.int_mailchimp__automation_recipients", "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48", "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9"], "model.mailchimp_source.stg_mailchimp__members": ["model.mailchimp.mailchimp__members", "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c", "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["model.mailchimp.mailchimp__campaign_activities", "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed", "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee"], "model.mailchimp_source.stg_mailchimp__segment_members": [], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_activities"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp_source.stg_mailchimp__lists"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp_source.stg_mailchimp__campaign_recipients"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["model.mailchimp_source.stg_mailchimp__segments", "model.mailchimp_source.stg_mailchimp__segments"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["model.mailchimp_source.stg_mailchimp__segment_members", "model.mailchimp_source.stg_mailchimp__segment_members"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["model.mailchimp_source.stg_mailchimp__members", "model.mailchimp_source.stg_mailchimp__members"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automation_emails"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automation_recipients"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaign_activities"], "model.mailchimp.mailchimp__automation_activities": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_segment", "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.69f7ec2ea4", "test.mailchimp.unique_mailchimp__automation_activities_activity_id.028a855f2c"], "model.mailchimp.mailchimp__lists": ["test.mailchimp.not_null_mailchimp__lists_list_id.3b19bed371", "test.mailchimp.unique_mailchimp__lists_list_id.ac74445e11"], "model.mailchimp.mailchimp__members": ["model.mailchimp.int_mailchimp__members_by_list", "test.mailchimp.not_null_mailchimp__members_member_id.b3d42f42f5", "test.mailchimp.unique_mailchimp__members_member_id.cf802ea62a"], "model.mailchimp.mailchimp__campaigns": ["test.mailchimp.not_null_mailchimp__campaigns_campaign_id.b2a5bb0c67", "test.mailchimp.unique_mailchimp__campaigns_campaign_id.17cc6ca14f"], "model.mailchimp.mailchimp__campaign_activities": ["model.mailchimp.int_mailchimp__campaign_activities_by_email", "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.f493ad0b31", "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.28bf1e5fbd"], "model.mailchimp.mailchimp__campaign_recipients": ["model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "model.mailchimp.int_mailchimp__campaign_activities_by_list", "model.mailchimp.int_mailchimp__campaign_activities_by_member", "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.3af4b3f655", "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.638c4769d4"], "model.mailchimp.mailchimp__automations": ["test.mailchimp.not_null_mailchimp__automations_automation_id.c6a95d5564", "test.mailchimp.unique_mailchimp__automations_automation_id.027f8f6fb3"], "model.mailchimp.mailchimp__automation_emails": ["test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.044b815e20", "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.218a63b754"], "model.mailchimp.mailchimp__segments": ["test.mailchimp.not_null_mailchimp__segments_segment_id.1b04ffa743", "test.mailchimp.unique_mailchimp__segments_segment_id.6fa54c3e6f"], "model.mailchimp.int_mailchimp__automation_activities_by_member": ["model.mailchimp.mailchimp__members"], "model.mailchimp.int_mailchimp__members_by_list": ["model.mailchimp.mailchimp__lists"], "model.mailchimp.int_mailchimp__automation_activities_by_list": ["model.mailchimp.mailchimp__lists"], "model.mailchimp.int_mailchimp__campaign_activities_by_list": ["model.mailchimp.mailchimp__lists"], "model.mailchimp.int_mailchimp__campaign_activities_by_member": ["model.mailchimp.mailchimp__members"], "model.mailchimp.int_mailchimp__campaign_activities_by_segment": ["model.mailchimp.mailchimp__segments"], "model.mailchimp.int_mailchimp__automation_activities_by_automation": ["model.mailchimp.mailchimp__automations"], "model.mailchimp.int_mailchimp__automation_activities_by_email": ["model.mailchimp.mailchimp__automation_emails"], "model.mailchimp.int_mailchimp__automation_unsubscribes": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_segment"], "model.mailchimp.int_mailchimp__campaign_activities_by_campaign": ["model.mailchimp.mailchimp__campaigns"], "model.mailchimp.int_mailchimp__automation_recipients": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_segment"], "model.mailchimp.int_mailchimp__automation_activities_by_segment": ["model.mailchimp.mailchimp__segments"], "model.mailchimp.int_mailchimp__campaign_activities_by_email": ["model.mailchimp.mailchimp__campaign_recipients"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67": [], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d": [], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48": [], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9": [], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096": [], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed": [], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346": [], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4": [], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb": [], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d": [], "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9": [], "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c": [], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83": [], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00": [], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e": [], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816": [], "test.mailchimp.unique_mailchimp__lists_list_id.ac74445e11": [], "test.mailchimp.not_null_mailchimp__lists_list_id.3b19bed371": [], "test.mailchimp.unique_mailchimp__members_member_id.cf802ea62a": [], "test.mailchimp.not_null_mailchimp__members_member_id.b3d42f42f5": [], "test.mailchimp.unique_mailchimp__campaigns_campaign_id.17cc6ca14f": [], "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.b2a5bb0c67": [], "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.638c4769d4": [], "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.3af4b3f655": [], "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.28bf1e5fbd": [], "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.f493ad0b31": [], "test.mailchimp.unique_mailchimp__automations_automation_id.027f8f6fb3": [], "test.mailchimp.not_null_mailchimp__automations_automation_id.c6a95d5564": [], "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.218a63b754": [], "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.044b815e20": [], "test.mailchimp.unique_mailchimp__automation_activities_activity_id.028a855f2c": [], "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.69f7ec2ea4": [], "test.mailchimp.unique_mailchimp__segments_segment_id.6fa54c3e6f": [], "test.mailchimp.not_null_mailchimp__segments_segment_id.1b04ffa743": [], "source.mailchimp_source.mailchimp.automation": ["model.mailchimp_source.stg_mailchimp__automations_tmp"], "source.mailchimp_source.mailchimp.automation_email": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "source.mailchimp_source.mailchimp.automation_recipient": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "source.mailchimp_source.mailchimp.automation_recipient_activity": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "source.mailchimp_source.mailchimp.campaign": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient_activity": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "source.mailchimp_source.mailchimp.segment": ["model.mailchimp_source.stg_mailchimp__segments_tmp"], "source.mailchimp_source.mailchimp.segment_member": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "source.mailchimp_source.mailchimp.list": ["model.mailchimp_source.stg_mailchimp__lists_tmp"], "source.mailchimp_source.mailchimp.member": ["model.mailchimp_source.stg_mailchimp__members_tmp"], "source.mailchimp_source.mailchimp.unsubscribe": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-01-12T20:14:09.892885Z", "invocation_id": "b34aa7dc-6b6b-4c9b-93da-d6b0325c8f1a", "env": {}, "project_id": "faebc42304447d4427374f806679ecb5", "user_id": "e607f749-4294-4b15-833b-0ae4a87d4d24", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"model.mailchimp_source.stg_mailchimp__segments": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segments_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segments_tmp')),\n staging_columns=get_segment_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segments"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__segments.sql", "original_file_path": "models/stg_mailchimp__segments.sql", "name": "stg_mailchimp__segments", "alias": "stg_mailchimp__segments", "checksum": {"name": "sha256", "checksum": "9a541d259b8016fe2430ed426ebf18b892a675e034a30ad5c0ac1b53337e5d8d"}, "tags": [], "refs": [["stg_mailchimp__segments_tmp"], ["stg_mailchimp__segments_tmp"]], "sources": [], "description": "Each record represents a segment in Mailchimp.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_name": {"name": "segment_name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_type": {"name": "segment_type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1642018188.3102, "compiled_sql": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_count\n \n as \n \n member_count\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_recipients_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_recipients_tmp')),\n staging_columns=get_campaign_recipient_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__campaign_recipients.sql", "original_file_path": "models/stg_mailchimp__campaign_recipients.sql", "name": "stg_mailchimp__campaign_recipients", "alias": "stg_mailchimp__campaign_recipients", "checksum": {"name": "sha256", "checksum": "962d18c80e7e0267bb0e229f1753457fb9be4f88fb9794590dddd173811d0c3a"}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients_tmp"], ["stg_mailchimp__campaign_recipients_tmp"]], "sources": [], "description": "Each record represents the send of a campaign email.", "columns": {"email_id": {"name": "email_id", "description": "The surrogate key that uses table campaign_id and member_id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1642018188.2731369, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n to_hex(md5(cast(coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') as \n string\n))) as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`"}, "model.mailchimp_source.stg_mailchimp__lists": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__lists_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__lists_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_list_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__lists"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__lists.sql", "original_file_path": "models/stg_mailchimp__lists.sql", "name": "stg_mailchimp__lists", "alias": "stg_mailchimp__lists", "checksum": {"name": "sha256", "checksum": "4d6a8a6e5f037e2b841245e3006ce38a78ae09f8fb01bc3d520f81d6242f46a5"}, "tags": [], "refs": [["stg_mailchimp__lists_tmp"], ["stg_mailchimp__lists_tmp"]], "sources": [], "description": "Each record represents a list in Mailchimp.", "columns": {"list_id": {"name": "list_id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__lists.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1642018188.297908, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n beamer_address\n \n as \n \n beamer_address\n \n, \n \n \n contact_address_1\n \n as \n \n contact_address_1\n \n, \n \n \n contact_address_2\n \n as \n \n contact_address_2\n \n, \n \n \n contact_city\n \n as \n \n contact_city\n \n, \n \n \n contact_company\n \n as \n \n contact_company\n \n, \n \n \n contact_country\n \n as \n \n contact_country\n \n, \n \n \n contact_state\n \n as \n \n contact_state\n \n, \n \n \n contact_zip\n \n as \n \n contact_zip\n \n, \n \n \n date_created\n \n as \n \n date_created\n \n, \n \n \n default_from_email\n \n as \n \n default_from_email\n \n, \n \n \n default_from_name\n \n as \n \n default_from_name\n \n, \n \n \n default_language\n \n as \n \n default_language\n \n, \n \n \n default_subject\n \n as \n \n default_subject\n \n, \n \n \n email_type_option\n \n as \n \n email_type_option\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_rating\n \n as \n \n list_rating\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notify_on_subscribe\n \n as \n \n notify_on_subscribe\n \n, \n \n \n notify_on_unsubscribe\n \n as \n \n notify_on_unsubscribe\n \n, \n \n \n permission_reminder\n \n as \n \n permission_reminder\n \n, \n \n \n subscribe_url_long\n \n as \n \n subscribe_url_long\n \n, \n \n \n subscribe_url_short\n \n as \n \n subscribe_url_short\n \n, \n \n \n use_archive_bar\n \n as \n \n use_archive_bar\n \n, \n \n \n visibility\n \n as \n \n visibility\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`"}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_activities_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_activities_tmp')),\n staging_columns=get_automation_recipient_activity_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['action_type', 'automation_email_id', 'member_id', 'activity_timestamp']) }} as activity_id\n from final\n)\n\nselect * from unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automation_activities.sql", "original_file_path": "models/stg_mailchimp__automation_activities.sql", "name": "stg_mailchimp__automation_activities", "alias": "stg_mailchimp__automation_activities", "checksum": {"name": "sha256", "checksum": "8f14be4acd168cb711c17e39998f9170001c7e2cbb9259a6561bc2c9b9164d17"}, "tags": [], "refs": [["stg_mailchimp__automation_activities_tmp"], ["stg_mailchimp__automation_activities_tmp"]], "sources": [], "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1642018188.2528682, "compiled_sql": "\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(action_type as \n string\n), '') || '-' || coalesce(cast(automation_email_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(activity_timestamp as \n string\n), '') as \n string\n))) as activity_id\n from final\n)\n\nselect * from unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`"}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__unsubscribes_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__unsubscribes_tmp')),\n staging_columns=get_unsubscribe_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key([ 'member_id', 'list_id', 'unsubscribe_timestamp']) }} as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_unsubscribe_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__unsubscribes"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__unsubscribes.sql", "original_file_path": "models/stg_mailchimp__unsubscribes.sql", "name": "stg_mailchimp__unsubscribes", "alias": "stg_mailchimp__unsubscribes", "checksum": {"name": "sha256", "checksum": "84ac8d45eb7917b03369f407770d7e279978cdd84d657c085c788524f7600e02"}, "tags": [], "refs": [["stg_mailchimp__unsubscribes_tmp"], ["stg_mailchimp__unsubscribes_tmp"]], "sources": [], "description": "Each record represents a member who unsubscribed.", "columns": {"unsubscribe_id": {"name": "unsubscribe_id", "description": "The surrogate key that uses table member_id, list_id, and unsubscribe_timestamp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__unsubscribes.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1642018188.3126452, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n reason\n \n as \n \n reason\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(list_id as \n string\n), '') || '-' || coalesce(cast(unsubscribe_timestamp as \n string\n), '') as \n string\n))) as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`"}, "model.mailchimp_source.stg_mailchimp__campaigns": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaigns_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaigns_tmp')),\n staging_columns=get_campaign_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaigns"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__campaigns.sql", "original_file_path": "models/stg_mailchimp__campaigns.sql", "name": "stg_mailchimp__campaigns", "alias": "stg_mailchimp__campaigns", "checksum": {"name": "sha256", "checksum": "56693d69d8c258df63e0d9bedc7606959093d93608786b62065df629537f7e96"}, "tags": [], "refs": [["stg_mailchimp__campaigns_tmp"], ["stg_mailchimp__campaigns_tmp"]], "sources": [], "description": "Each record represents a campaign in Mailchimp.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_timestamp": {"name": "create_timestamp", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to_email": {"name": "reply_to_email", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaigns.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1642018188.289501, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n long_archive_url\n \n as \n \n long_archive_url\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n test_size\n \n as \n \n test_size\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n, \n \n \n wait_time\n \n as \n \n wait_time\n \n, \n \n \n winner_criteria\n \n as \n \n winner_criteria\n \n, \n \n \n winning_campaign_id\n \n as \n \n winning_campaign_id\n \n, \n \n \n winning_combination_id\n \n as \n \n winning_combination_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`"}, "model.mailchimp_source.stg_mailchimp__automations": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__automations_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automations_tmp')),\n staging_columns=get_automation_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automations"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automations.sql", "original_file_path": "models/stg_mailchimp__automations.sql", "name": "stg_mailchimp__automations", "alias": "stg_mailchimp__automations", "checksum": {"name": "sha256", "checksum": "d53e4be91338f237ad9434b3962987eea297a7259b2109096f46c8a04df49144"}, "tags": [], "refs": [["stg_mailchimp__automations_tmp"], ["stg_mailchimp__automations_tmp"]], "sources": [], "description": "Each record represents an automation in Mailchimp.", "columns": {"automation_id": {"name": "automation_id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automations.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1642018188.270924, "compiled_sql": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n trigger_settings\n \n as \n \n trigger_settings\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`"}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_emails_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_emails_tmp')),\n staging_columns=get_automation_email_columns()\n )\n }}\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_email_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_emails"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automation_emails.sql", "original_file_path": "models/stg_mailchimp__automation_emails.sql", "name": "stg_mailchimp__automation_emails", "alias": "stg_mailchimp__automation_emails", "checksum": {"name": "sha256", "checksum": "d4a7ad6a314a52074f4cc4486a63f7f1f1f9bf7b89605427d38c10fa33bf9f38"}, "tags": [], "refs": [["stg_mailchimp__automation_emails_tmp"], ["stg_mailchimp__automation_emails_tmp"]], "sources": [], "description": "Each record represents an automation email (that make up automations).", "columns": {"automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_emails.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1642018188.2656052, "compiled_sql": "\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n automation_id\n \n as \n \n automation_id\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n delay_action\n \n as \n \n delay_action\n \n, \n \n \n delay_action_description\n \n as \n \n delay_action_description\n \n, \n \n \n delay_amount\n \n as \n \n delay_amount\n \n, \n \n \n delay_direction\n \n as \n \n delay_direction\n \n, \n \n \n delay_full_description\n \n as \n \n delay_full_description\n \n, \n \n \n delay_type\n \n as \n \n delay_type\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n position\n \n as \n \n position\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n\n\n\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`"}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_recipients_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_recipients_tmp')),\n staging_columns=get_automation_recipient_columns()\n )\n }}\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n {{ dbt_utils.surrogate_key(['member_id','automation_email_id']) }} as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automation_recipients.sql", "original_file_path": "models/stg_mailchimp__automation_recipients.sql", "name": "stg_mailchimp__automation_recipients", "alias": "stg_mailchimp__automation_recipients", "checksum": {"name": "sha256", "checksum": "0b527204f8677d081d0c2ee753e4dcc39e166176599674729ab183e1ceeab443"}, "tags": [], "refs": [["stg_mailchimp__automation_recipients_tmp"], ["stg_mailchimp__automation_recipients_tmp"]], "sources": [], "description": "Each record represents info about the recipient of each automation.", "columns": {"automation_recipient_id": {"name": "automation_recipient_id", "description": "Surrogate key that uses member_id and automation_email_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1642018188.267387, "compiled_sql": "\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n to_hex(md5(cast(coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(automation_email_id as \n string\n), '') as \n string\n))) as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`"}, "model.mailchimp_source.stg_mailchimp__members": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__members_tmp')),\n staging_columns=get_member_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n {{ fivetran_utils.fill_pass_through_columns('mailchimp__members_pass_through_columns') }}\n \n from fields\n\n), unique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['member_id','list_id']) }} as list_member_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_member_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.fill_pass_through_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__members"], "unique_id": "model.mailchimp_source.stg_mailchimp__members", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__members.sql", "original_file_path": "models/stg_mailchimp__members.sql", "name": "stg_mailchimp__members", "alias": "stg_mailchimp__members", "checksum": {"name": "sha256", "checksum": "b017cf3ac38080474093fcaed225da757d70074eb7783fc377525aaeb04c1c33"}, "tags": [], "refs": [["stg_mailchimp__members_tmp"], ["stg_mailchimp__members_tmp"]], "sources": [], "description": "Each record represents a member in Mailchimp.", "columns": {"list_member_id": {"name": "list_member_id", "description": "The ID of each record, from combining member id and list id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_timestamp": {"name": "signup_timestamp", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_timestamp": {"name": "opt_in_timestamp", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed_timestamp": {"name": "last_changed_timestamp", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_ip_address": {"name": "opt_in_ip_address", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_ip_address": {"name": "signup_ip_address", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1642018188.3055758, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n dstoff\n \n as \n \n dstoff\n \n, \n \n \n email_address\n \n as \n \n email_address\n \n, \n \n \n email_client\n \n as \n \n email_client\n \n, \n \n \n email_type\n \n as \n \n email_type\n \n, \n \n \n gmtoff\n \n as \n \n gmtoff\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n ip_opt\n \n as \n \n ip_opt\n \n, \n \n \n ip_signup\n \n as \n \n ip_signup\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n last_changed\n \n as \n \n last_changed\n \n, \n \n \n latitude\n \n as \n \n latitude\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n longitude\n \n as \n \n longitude\n \n, \n \n \n member_rating\n \n as \n \n member_rating\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n timestamp_opt\n \n as \n \n timestamp_opt\n \n, \n \n \n timestamp_signup\n \n as \n \n timestamp_signup\n \n, \n \n \n timezone\n \n as \n \n timezone\n \n, \n \n \n unique_email_id\n \n as \n \n unique_email_id\n \n, \n \n \n vip\n \n as \n \n vip\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n \n\n\n\n\n \n from fields\n\n), unique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(list_id as \n string\n), '') as \n string\n))) as list_member_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`"}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_activities_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_activities_tmp')),\n staging_columns=get_campaign_recipient_activity_columns()\n )\n }}\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['action_type', 'campaign_id', 'member_id', 'activity_timestamp']) }} as activity_id,\n {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__campaign_activities.sql", "original_file_path": "models/stg_mailchimp__campaign_activities.sql", "name": "stg_mailchimp__campaign_activities", "alias": "stg_mailchimp__campaign_activities", "checksum": {"name": "sha256", "checksum": "8d4a84a98808c477676406497afd536b55e88dd028845c96dc2912a52abe06cc"}, "tags": [], "refs": [["stg_mailchimp__campaign_activities_tmp"], ["stg_mailchimp__campaign_activities_tmp"]], "sources": [], "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_id": {"name": "email_id", "description": "The ID of the email sent. (Created in dbt, not Mailchimp.)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1642018188.2770612, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(action_type as \n string\n), '') || '-' || coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(activity_timestamp as \n string\n), '') as \n string\n))) as activity_id,\n to_hex(md5(cast(coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') as \n string\n))) as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`"}, "model.mailchimp_source.stg_mailchimp__segment_members": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segment_members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segment_members_tmp')),\n staging_columns=get_segment_member_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n), unique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['segment_id','member_id']) }} as segment_member_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_member_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segment_members"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "stg_mailchimp__segment_members.sql", "original_file_path": "models/stg_mailchimp__segment_members.sql", "name": "stg_mailchimp__segment_members", "alias": "stg_mailchimp__segment_members", "checksum": {"name": "sha256", "checksum": "dade9556358420b5343c77cb7e517c741bfdc5be04ea9f17a03b72b000caab17"}, "tags": [], "refs": [["stg_mailchimp__segment_members_tmp"], ["stg_mailchimp__segment_members_tmp"]], "sources": [], "description": "Each record represents a member and their segment data.", "columns": {"segment_member_id": {"name": "segment_member_id", "description": "The ID of each record, from combining segment id and member id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segment_members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1642018188.307368, "compiled_sql": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n), unique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(segment_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') as \n string\n))) as segment_member_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members`"}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient_activity') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient_activity"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automation_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_activities_tmp.sql", "name": "stg_mailchimp__automation_activities_tmp", "alias": "stg_mailchimp__automation_activities_tmp", "checksum": {"name": "sha256", "checksum": "99dd3be31bece932a946f44c80ffe85b9b21d998ddaf1d7a4fb9108f9b4f3566"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient_activity"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1642018187.9726279, "compiled_sql": "\n\nselect * from `dbt-package-testing`.`mailchimp`.`automation_recipient_activity`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities_tmp`"}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"raw_sql": "select * from {{ var('unsubscribe') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.unsubscribe"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__unsubscribes_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__unsubscribes_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "name": "stg_mailchimp__unsubscribes_tmp", "alias": "stg_mailchimp__unsubscribes_tmp", "checksum": {"name": "sha256", "checksum": "49ddeb7631aa624011d6fd5f608b80fa284ca6443a837c941d31cc864e99efca"}, "tags": [], "refs": [], "sources": [["mailchimp", "unsubscribe"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1642018187.981471, "compiled_sql": "select * from `dbt-package-testing`.`mailchimp`.`unsubscribe`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes_tmp`"}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"raw_sql": "select * from {{ var('list') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.list"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__lists_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__lists_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__lists_tmp.sql", "name": "stg_mailchimp__lists_tmp", "alias": "stg_mailchimp__lists_tmp", "checksum": {"name": "sha256", "checksum": "f2334dfd1f22372c81a53cb1903dc8accef34fbf98c0a3477bd0ca373cffd83d"}, "tags": [], "refs": [], "sources": [["mailchimp", "list"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__lists_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1642018187.986798, "compiled_sql": "select * from `dbt-package-testing`.`mailchimp`.`list`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"raw_sql": "select * from {{ var('campaign_recipient') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "name": "stg_mailchimp__campaign_recipients_tmp", "alias": "stg_mailchimp__campaign_recipients_tmp", "checksum": {"name": "sha256", "checksum": "6208dd636a377fb8462ee7838ec92a9b3592f5861f42c6dd803aa8c32e6fe3f5"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1642018187.9922292, "compiled_sql": "select * from `dbt-package-testing`.`mailchimp`.`campaign_recipient`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients_tmp`"}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('mailchimp_segment') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segments_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__segments_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segments_tmp.sql", "name": "stg_mailchimp__segments_tmp", "alias": "stg_mailchimp__segments_tmp", "checksum": {"name": "sha256", "checksum": "4235011fcab4cb786bf93907ba23fa09882a56e9430b6fc13bf0425c2cb5cc09"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segments_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1642018187.9972422, "compiled_sql": "\n\nselect * from `dbt-package-testing`.`mailchimp`.`segment`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"raw_sql": "select * from {{ var('campaign') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaigns_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__campaigns_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaigns_tmp.sql", "name": "stg_mailchimp__campaigns_tmp", "alias": "stg_mailchimp__campaigns_tmp", "checksum": {"name": "sha256", "checksum": "b96a24c9964cf05208bd2a9e0d0ce0455a507b9f07026887f777922df4942cd9"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaigns_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1642018188.0020359, "compiled_sql": "select * from `dbt-package-testing`.`mailchimp`.`campaign`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns_tmp`"}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('segment_member') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment_member"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segment_members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__segment_members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segment_members_tmp.sql", "name": "stg_mailchimp__segment_members_tmp", "alias": "stg_mailchimp__segment_members_tmp", "checksum": {"name": "sha256", "checksum": "5b6ac15d76b277f0b9f4d99dab168471e7e599bf8e79bd491dc412cfd5e9b48b"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment_member"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segment_members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1642018188.007134, "compiled_sql": "\n\nselect * from `dbt-package-testing`.`mailchimp`.`segment_member`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members_tmp`"}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"raw_sql": "select * from {{ var('member') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.member"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__members_tmp.sql", "name": "stg_mailchimp__members_tmp", "alias": "stg_mailchimp__members_tmp", "checksum": {"name": "sha256", "checksum": "5fe9a82d5a301c2dd82f196d47d882b6c2083528bd8b53f1a49591496b729b5e"}, "tags": [], "refs": [], "sources": [["mailchimp", "member"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1642018188.011988, "compiled_sql": "select * from `dbt-package-testing`.`mailchimp`.`member`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members_tmp`"}, "model.mailchimp_source.stg_mailchimp__automations_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automations_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automations_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automations_tmp.sql", "name": "stg_mailchimp__automations_tmp", "alias": "stg_mailchimp__automations_tmp", "checksum": {"name": "sha256", "checksum": "2d97a5eacee487f94b5553490b28db0d5252d917897965fa442e884a547e78d3"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automations_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1642018188.016403, "compiled_sql": "\n\nselect * from `dbt-package-testing`.`mailchimp`.`automation`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations_tmp`"}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_email') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_email"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_emails_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automation_emails_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_emails_tmp.sql", "name": "stg_mailchimp__automation_emails_tmp", "alias": "stg_mailchimp__automation_emails_tmp", "checksum": {"name": "sha256", "checksum": "9ee9a3419a66bfb12b2c084315fdf33a0751480aa6b206c201cfb3feca13a465"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_email"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_emails_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1642018188.021931, "compiled_sql": "\n\nselect * from `dbt-package-testing`.`mailchimp`.`automation_email`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails_tmp`"}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automation_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "name": "stg_mailchimp__automation_recipients_tmp", "alias": "stg_mailchimp__automation_recipients_tmp", "checksum": {"name": "sha256", "checksum": "28eeb5e9f065dcf688d7bff8b450ba06adb13628fe476e0091d49740ed8b1241"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1642018188.0267992, "compiled_sql": "\n\nselect * from `dbt-package-testing`.`mailchimp`.`automation_recipient`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"raw_sql": "select * from {{ var('campaign_recipient_activity') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "name": "stg_mailchimp__campaign_activities_tmp", "alias": "stg_mailchimp__campaign_activities_tmp", "checksum": {"name": "sha256", "checksum": "50e7e9bdfd1bded394388edd76798d6b59b30bbfac7181e2e108401c179c9e78"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient_activity"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1642018188.031716, "compiled_sql": "select * from `dbt-package-testing`.`mailchimp`.`campaign_recipient_activity`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities_tmp`"}, "model.mailchimp.mailchimp__automation_activities": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ var('automation_recipient_activity') }}\n\n), automation_emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n activities.*,\n automations.automation_id,\n automations.segment_id\n from activities\n left join automation_emails\n on activities.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__automation_activities"], "unique_id": "model.mailchimp.mailchimp__automation_activities", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__automation_activities.sql", "original_file_path": "models/mailchimp__automation_activities.sql", "name": "mailchimp__automation_activities", "alias": "mailchimp__automation_activities", "checksum": {"name": "sha256", "checksum": "3f19dfa1aa531de4dab8bb860b585e2db4c3848b6959da197da19a106813f40a"}, "tags": [], "refs": [["stg_mailchimp__automation_activities"], ["stg_mailchimp__automation_emails"], ["stg_mailchimp__automations"]], "sources": [], "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID for the automation that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID for the Segment that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__automation_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1642018188.4863749, "compiled_sql": "\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n activities.*,\n automations.automation_id,\n automations.segment_id\n from activities\n left join automation_emails\n on activities.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`"}, "model.mailchimp.mailchimp__lists": {"raw_sql": "with lists as (\n\n select *\n from {{ var('list')}}\n\n), campaign_activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_list') }}\n\n), members as (\n\n select *\n from {{ ref('int_mailchimp__members_by_list') }}\n\n), members_xf as (\n\n select \n lists.*,\n coalesce(members.count_members,0) as count_members,\n members.most_recent_signup_timestamp\n from lists\n left join members\n on lists.list_id = members.list_id\n\n), metrics as (\n\n select \n members_xf.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members_xf\n left join campaign_activities\n on members_xf.list_id = campaign_activities.list_id\n\n{% if var('mailchimp_using_automations', True) %}\n\n), automation_activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_list') }}\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.list_id = automation_activities.list_id\n\n)\n\nselect *\nfrom metrics_xf\n\n{% else %}\n\n)\n\nselect *\nfrom metrics \n\n{% endif %}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp.int_mailchimp__campaign_activities_by_list", "model.mailchimp.int_mailchimp__members_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_list"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__lists"], "unique_id": "model.mailchimp.mailchimp__lists", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__lists.sql", "original_file_path": "models/mailchimp__lists.sql", "name": "mailchimp__lists", "alias": "mailchimp__lists", "checksum": {"name": "sha256", "checksum": "f2544a3b568ba214f586dd746088f0fa38ae8dc3b1ce6c362368c65637ef5c95"}, "tags": [], "refs": [["stg_mailchimp__lists"], ["int_mailchimp__campaign_activities_by_list"], ["int_mailchimp__members_by_list"], ["int_mailchimp__automation_activities_by_list"]], "sources": [], "description": "Each record represents a list in Mailchimp, enriched with campaign metrics, (optionally) automation metrics and information about members.", "columns": {"list_id": {"name": "list_id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "count_members": {"name": "count_members", "description": "The number of members in a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "most_recent_signup_timestamp": {"name": "most_recent_signup_timestamp", "description": "The date of the most recent signup to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_sends": {"name": "campaign_sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_opens": {"name": "campaign_opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_clicks": {"name": "campaign_clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_opens": {"name": "campaign_unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_clicks": {"name": "campaign_unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unsubscribes": {"name": "campaign_unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_sends": {"name": "automation_sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_opens": {"name": "automation_opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_clicks": {"name": "automation_clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_opens": {"name": "automation_unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_clicks": {"name": "automation_unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unsubscribes": {"name": "automation_unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__lists.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1642018188.377274, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_list as (\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n), __dbt__cte__int_mailchimp__members_by_list as (\nwith members as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__members`\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list\n), __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_list as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined\n),lists as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\n\n), campaign_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_list\n\n), members as (\n\n select *\n from __dbt__cte__int_mailchimp__members_by_list\n\n), members_xf as (\n\n select \n lists.*,\n coalesce(members.count_members,0) as count_members,\n members.most_recent_signup_timestamp\n from lists\n left join members\n on lists.list_id = members.list_id\n\n), metrics as (\n\n select \n members_xf.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members_xf\n left join campaign_activities\n on members_xf.list_id = campaign_activities.list_id\n\n\n\n), automation_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_list\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.list_id = automation_activities.list_id\n\n)\n\nselect *\nfrom metrics_xf\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_list", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_list as (\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}, {"id": "model.mailchimp.int_mailchimp__members_by_list", "sql": " __dbt__cte__int_mailchimp__members_by_list as (\nwith members as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__members`\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_list", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_list as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__lists`"}, "model.mailchimp.mailchimp__members": {"raw_sql": "with members as (\n\n select *\n from {{ var('member')}}\n\n), campaign_activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_member') }}\n\n), metrics as (\n\n select \n members.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members\n left join campaign_activities\n on members.member_id = campaign_activities.member_id\n\n{% if var('mailchimp_using_automations', True) %}\n\n), automation_activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_member') }}\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.member_id = automation_activities.member_id\n\n)\n\nselect *\nfrom metrics_xf\n\n{% else %}\n\n)\n\nselect *\nfrom metrics \n\n{% endif %}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__members", "model.mailchimp.int_mailchimp__campaign_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_member"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__members"], "unique_id": "model.mailchimp.mailchimp__members", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__members.sql", "original_file_path": "models/mailchimp__members.sql", "name": "mailchimp__members", "alias": "mailchimp__members", "checksum": {"name": "sha256", "checksum": "d4450db1829e3770f05a760daf7b5d6a8da3ecc50012aaea0db52d61779bdaae"}, "tags": [], "refs": [["stg_mailchimp__members"], ["int_mailchimp__campaign_activities_by_member"], ["int_mailchimp__automation_activities_by_member"]], "sources": [], "description": "Each record represents a member in Mailchimp, enriched with campaign metrics and (optionally) automation metrics.", "columns": {"list_member_id": {"name": "list_member_id", "description": "The ID of each record, from combining member id and list id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_timestamp": {"name": "signup_timestamp", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_timestamp": {"name": "opt_in_timestamp", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed_timestamp": {"name": "last_changed_timestamp", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_ip_address": {"name": "opt_in_ip_address", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_ip_address": {"name": "signup_ip_address", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_sends": {"name": "campaign_sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_opens": {"name": "campaign_opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_clicks": {"name": "campaign_clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_opens": {"name": "campaign_unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_clicks": {"name": "campaign_unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unsubscribes": {"name": "campaign_unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_sends": {"name": "automation_sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_opens": {"name": "automation_opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_clicks": {"name": "automation_clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_opens": {"name": "automation_unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_clicks": {"name": "automation_unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unsubscribes": {"name": "automation_unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__members.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1642018188.390455, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_member as (\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n), __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_member as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined\n),members as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\n\n), campaign_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_member\n\n), metrics as (\n\n select \n members.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes\n from members\n left join campaign_activities\n on members.member_id = campaign_activities.member_id\n\n\n\n), automation_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_member\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.member_id = automation_activities.member_id\n\n)\n\nselect *\nfrom metrics_xf\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_member", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_member as (\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_member", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_member as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__members`"}, "model.mailchimp.mailchimp__campaigns": {"raw_sql": "with campaigns as (\n\n select *\n from {{ var('campaign')}}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_campaign') }}\n\n), joined as (\n\n select \n campaigns.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from campaigns\n left join activities\n on campaigns.campaign_id = activities.campaign_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp.int_mailchimp__campaign_activities_by_campaign"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__campaigns"], "unique_id": "model.mailchimp.mailchimp__campaigns", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__campaigns.sql", "original_file_path": "models/mailchimp__campaigns.sql", "name": "mailchimp__campaigns", "alias": "mailchimp__campaigns", "checksum": {"name": "sha256", "checksum": "c017738b04b6f5b686197a385d5f237977c68011fd4f8b2ea1f039af5fb1abb0"}, "tags": [], "refs": [["stg_mailchimp__campaigns"], ["int_mailchimp__campaign_activities_by_campaign"]], "sources": [], "description": "Each record represents a campaign in Mailchimp, enriched with click, open and unsubscribe metrics.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_timestamp": {"name": "create_timestamp", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to_email": {"name": "reply_to_email", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sends": {"name": "sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unsubscribes": {"name": "unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__campaigns.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1642018188.44057, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_campaign as (\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n),campaigns as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_campaign\n\n), joined as (\n\n select \n campaigns.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from campaigns\n left join activities\n on campaigns.campaign_id = activities.campaign_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_campaign as (\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaigns`"}, "model.mailchimp.mailchimp__campaign_activities": {"raw_sql": "with activities as (\n\n select *\n from {{ ref('stg_mailchimp__campaign_activities') }}\n\n), campaigns as (\n\n select *\n from {{ var('campaign') }}\n\n), since_send as (\n\n select \n activities.*,\n campaigns.send_timestamp,\n {{ dbt_utils.datediff('campaigns.send_timestamp','activities.activity_timestamp','minute') }} as time_since_send_minutes,\n {{ dbt_utils.datediff('campaigns.send_timestamp','activities.activity_timestamp','hour') }} as time_since_send_hours,\n {{ dbt_utils.datediff('campaigns.send_timestamp','activities.activity_timestamp','day') }} as time_since_send_days\n from activities\n left join campaigns\n on activities.campaign_id = campaigns.campaign_id\n\n)\n\nselect *\nfrom since_send", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.datediff"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__campaign_activities"], "unique_id": "model.mailchimp.mailchimp__campaign_activities", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__campaign_activities.sql", "original_file_path": "models/mailchimp__campaign_activities.sql", "name": "mailchimp__campaign_activities", "alias": "mailchimp__campaign_activities", "checksum": {"name": "sha256", "checksum": "10540a96eb968a2a16c8e26d711a30d18d583f575445bc8157bfffa5f473d5b4"}, "tags": [], "refs": [["stg_mailchimp__campaign_activities"], ["stg_mailchimp__campaigns"]], "sources": [], "description": "Each record represents an activity taken in relation to a campaign email, enriched with data about when the campaign was sent and the lag between send and the activity.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_id": {"name": "email_id", "description": "The ID of the email sent. (Created in dbt, not Mailchimp.)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The time the campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_since_send_minutes": {"name": "time_since_send_minutes", "description": "The time from send to activity in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_since_send_hours": {"name": "time_since_send_hours", "description": "The time from send to activity in hours.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_since_send_days": {"name": "time_since_send_days", "description": "The time from send to activity in days.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__campaign_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1642018188.456544, "compiled_sql": "with activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\n\n), campaigns as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\n\n), since_send as (\n\n select \n activities.*,\n campaigns.send_timestamp,\n \n\n datetime_diff(\n cast(activities.activity_timestamp as datetime),\n cast(campaigns.send_timestamp as datetime),\n minute\n )\n\n as time_since_send_minutes,\n \n\n datetime_diff(\n cast(activities.activity_timestamp as datetime),\n cast(campaigns.send_timestamp as datetime),\n hour\n )\n\n as time_since_send_hours,\n \n\n datetime_diff(\n cast(activities.activity_timestamp as datetime),\n cast(campaigns.send_timestamp as datetime),\n day\n )\n\n as time_since_send_days\n from activities\n left join campaigns\n on activities.campaign_id = campaigns.campaign_id\n\n)\n\nselect *\nfrom since_send", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`"}, "model.mailchimp.mailchimp__campaign_recipients": {"raw_sql": "with recipients as (\n \n select *\n from {{ var('campaign_recipient') }}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_email') }}\n\n), unsubscribes as (\n\n select *\n from {{ var('unsubscribe') }}\n\n), campaigns as (\n\n select *\n from {{ var('campaign') }}\n\n), joined as (\n\n select \n recipients.*,\n campaigns.segment_id,\n campaigns.send_timestamp\n from recipients\n left join campaigns\n on recipients.campaign_id = campaigns.campaign_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.was_opened, False) as was_opened,\n coalesce(activities.was_clicked, False) as was_clicked,\n activities.first_open_timestamp,\n activities.time_to_open_minutes,\n activities.time_to_open_hours,\n activities.time_to_open_days\n from joined\n left join activities\n on joined.email_id = activities.email_id\n\n), unsubscribes_xf as (\n\n select \n member_id,\n campaign_id\n from unsubscribes\n group by 1,2\n\n), metrics_xf as (\n\n select \n metrics.*,\n case when unsubscribes_xf.member_id is not null then True else False end as was_unsubscribed\n from metrics\n left join unsubscribes_xf\n on metrics.member_id = unsubscribes_xf.member_id\n and metrics.campaign_id = unsubscribes_xf.campaign_id\n\n)\n\nselect * \nfrom metrics_xf", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp.int_mailchimp__campaign_activities_by_email", "model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__campaign_recipients"], "unique_id": "model.mailchimp.mailchimp__campaign_recipients", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__campaign_recipients.sql", "original_file_path": "models/mailchimp__campaign_recipients.sql", "name": "mailchimp__campaign_recipients", "alias": "mailchimp__campaign_recipients", "checksum": {"name": "sha256", "checksum": "f21d83f3c0ee06ea700fb656944f42bbfc9eaa6471e18d42c7e79563d49cf319"}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients"], ["int_mailchimp__campaign_activities_by_email"], ["stg_mailchimp__unsubscribes"], ["stg_mailchimp__campaigns"]], "sources": [], "description": "Each record represents the send of a campaign email, enriched with click, open and unsubscribe metrics.", "columns": {"email_id": {"name": "email_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the segment the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "was_opened": {"name": "was_opened", "description": "Whether the email sent was opened.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "was_clicked": {"name": "was_clicked", "description": "Whether the email sent was clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_open_timestamp": {"name": "first_open_timestamp", "description": "The timestamp of the first open for an email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_to_open_minutes": {"name": "time_to_open_minutes", "description": "The time from send to open in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_to_open_hours": {"name": "time_to_open_hours", "description": "The time from send to open in hours.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "time_to_open_days": {"name": "time_to_open_days", "description": "The time from send to open in days.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "was_unsubscribed": {"name": "was_unsubscribed", "description": "Whether the user unsubscribed via the sent email.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__campaign_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table"}, "created_at": 1642018188.449238, "compiled_sql": "with __dbt__cte__int_mailchimp__campaign_activities_by_email as (\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans\n),recipients as (\n \n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_email\n\n), unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), campaigns as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\n\n), joined as (\n\n select \n recipients.*,\n campaigns.segment_id,\n campaigns.send_timestamp\n from recipients\n left join campaigns\n on recipients.campaign_id = campaigns.campaign_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.was_opened, False) as was_opened,\n coalesce(activities.was_clicked, False) as was_clicked,\n activities.first_open_timestamp,\n activities.time_to_open_minutes,\n activities.time_to_open_hours,\n activities.time_to_open_days\n from joined\n left join activities\n on joined.email_id = activities.email_id\n\n), unsubscribes_xf as (\n\n select \n member_id,\n campaign_id\n from unsubscribes\n group by 1,2\n\n), metrics_xf as (\n\n select \n metrics.*,\n case when unsubscribes_xf.member_id is not null then True else False end as was_unsubscribed\n from metrics\n left join unsubscribes_xf\n on metrics.member_id = unsubscribes_xf.member_id\n and metrics.campaign_id = unsubscribes_xf.campaign_id\n\n)\n\nselect * \nfrom metrics_xf", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_email", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_email as (\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans\n)"}], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`"}, "model.mailchimp.mailchimp__automations": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith automations as (\n\n select *\n from {{ var('automation')}}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_automation') }}\n\n), joined as (\n\n select \n automations.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from automations\n left join activities\n on automations.automation_id = activities.automation_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp.int_mailchimp__automation_activities_by_automation"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__automations"], "unique_id": "model.mailchimp.mailchimp__automations", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__automations.sql", "original_file_path": "models/mailchimp__automations.sql", "name": "mailchimp__automations", "alias": "mailchimp__automations", "checksum": {"name": "sha256", "checksum": "f840bd0b805652fd09bb2d81f6f6afba0da4c21532b0331865c415407148debe"}, "tags": [], "refs": [["stg_mailchimp__automations"], ["int_mailchimp__automation_activities_by_automation"]], "sources": [], "description": "Each record represents an automation in Mailchimp, enriched with click, open and unsubscribe metrics. (Enabled if you are using automations.)", "columns": {"automation_id": {"name": "automation_id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sends": {"name": "sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unsubscribes": {"name": "unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__automations.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1642018188.4630558, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_automation as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined\n),automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_automation\n\n), joined as (\n\n select \n automations.*,\n coalesce(activities.sends,0) as sends,\n coalesce(activities.opens,0) as opens,\n coalesce(activities.clicks,0) as clicks,\n coalesce(activities.unique_opens,0) as unique_opens,\n coalesce(activities.unique_clicks,0) as unique_clicks,\n coalesce(activities.unsubscribes,0) as unsubscribes\n from automations\n left join activities\n on automations.automation_id = activities.automation_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_automation", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_automation as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automations`"}, "model.mailchimp.mailchimp__automation_emails": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n emails.*,\n automations.list_id,\n automations.segment_id\n from emails\n left join automations\n on emails.automation_id = automations.automation_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.sends, 0) as sends,\n coalesce(activities.opens, 0) as opens,\n coalesce(activities.clicks, 0) as clicks,\n coalesce(activities.unique_opens, 0) as unique_opens,\n coalesce(activities.unique_clicks, 0) as unique_clicks,\n coalesce(activities.unsubscribes, 0) as unsubscribes\n from joined\n left join activities\n on joined.automation_email_id = activities.automation_email_id\n\n)\n\nselect * \nfrom metrics", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__automation_emails"], "unique_id": "model.mailchimp.mailchimp__automation_emails", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__automation_emails.sql", "original_file_path": "models/mailchimp__automation_emails.sql", "name": "mailchimp__automation_emails", "alias": "mailchimp__automation_emails", "checksum": {"name": "sha256", "checksum": "aaf2554526f64bec3baf3a9da0b280a42a10f4e9001b39cb9fda3091fdd0add5"}, "tags": [], "refs": [["stg_mailchimp__automation_emails"], ["int_mailchimp__automation_activities_by_email"], ["stg_mailchimp__automations"]], "sources": [], "description": "Each record represents an automation email (that make up automations), enriched with click, open and unsubscribe metrics. (Enabled if you are using automations.)", "columns": {"automation_email_id": {"name": "automation_email_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List this automation email is being sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment this automation email is being sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sends": {"name": "sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opens": {"name": "opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_opens": {"name": "unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_clicks": {"name": "unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unsubscribes": {"name": "unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__automation_emails.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1642018188.4813561, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_email as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined\n),emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_email\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n emails.*,\n automations.list_id,\n automations.segment_id\n from emails\n left join automations\n on emails.automation_id = automations.automation_id\n\n), metrics as (\n\n select\n joined.*,\n coalesce(activities.sends, 0) as sends,\n coalesce(activities.opens, 0) as opens,\n coalesce(activities.clicks, 0) as clicks,\n coalesce(activities.unique_opens, 0) as unique_opens,\n coalesce(activities.unique_clicks, 0) as unique_clicks,\n coalesce(activities.unsubscribes, 0) as unsubscribes\n from joined\n left join activities\n on joined.automation_email_id = activities.automation_email_id\n\n)\n\nselect * \nfrom metrics", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_email", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_email as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_emails`"}, "model.mailchimp.mailchimp__segments": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith segments as (\n\n select *\n from {{ var('mailchimp_segment')}}\n\n), campaign_activities as (\n\n select *\n from {{ ref('int_mailchimp__campaign_activities_by_segment') }}\n\n), lists as (\n\n select *\n from {{ var('list')}}\n\n), metrics as (\n\n select \n segments.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes,\n lists.name as list_name\n\n from segments\n left join campaign_activities\n on segments.segment_id = campaign_activities.segment_id\n left join lists \n on segments.list_id = lists.list_id\n\n{% if var('mailchimp_using_automations', True) %}\n\n), automation_activities as (\n\n select *\n from {{ ref('int_mailchimp__automation_activities_by_segment') }}\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.segment_id = automation_activities.segment_id\n\n)\n\nselect *\nfrom metrics_xf\n\n{% else %}\n\n)\n\nselect *\nfrom metrics \n\n{% endif %}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__segments", "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp.int_mailchimp__automation_activities_by_segment"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "mailchimp__segments"], "unique_id": "model.mailchimp.mailchimp__segments", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp__segments.sql", "original_file_path": "models/mailchimp__segments.sql", "name": "mailchimp__segments", "alias": "mailchimp__segments", "checksum": {"name": "sha256", "checksum": "c15c826314f1107b79343a2d65e537b4413a3206773c1f4a841768a124647585"}, "tags": [], "refs": [["stg_mailchimp__segments"], ["int_mailchimp__campaign_activities_by_segment"], ["stg_mailchimp__lists"], ["int_mailchimp__automation_activities_by_segment"]], "sources": [], "description": "Each record represents a segment in Mailchimp, enriched with campaign metrics and (optionally) automation metrics. (Enabled if you are using segments.)", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_name": {"name": "list_name", "description": "The name of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_name": {"name": "segment_name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_type": {"name": "segment_type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_sends": {"name": "campaign_sends", "description": "The number of sent emails from campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_opens": {"name": "campaign_opens", "description": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_clicks": {"name": "campaign_clicks", "description": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_opens": {"name": "campaign_unique_opens", "description": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unique_clicks": {"name": "campaign_unique_clicks", "description": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_unsubscribes": {"name": "campaign_unsubscribes", "description": "The number of users who have unsubscribed from campaign emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_sends": {"name": "automation_sends", "description": "The number of sent emails from automations.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_opens": {"name": "automation_opens", "description": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_clicks": {"name": "automation_clicks", "description": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_opens": {"name": "automation_unique_opens", "description": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unique_clicks": {"name": "automation_unique_clicks", "description": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_unsubscribes": {"name": "automation_unsubscribes", "description": "The number of users who have unsubscribed from automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp://models/mailchimp.yml", "compiled_path": "target/compiled/mailchimp/models/mailchimp__segments.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "table", "enabled": true}, "created_at": 1642018188.494316, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__campaign_activities_by_segment as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted\n), __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_activities_by_segment as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined\n),segments as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\n\n), campaign_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__campaign_activities_by_segment\n\n), lists as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\n\n), metrics as (\n\n select \n segments.*,\n coalesce(campaign_activities.sends,0) as campaign_sends,\n coalesce(campaign_activities.opens,0) as campaign_opens,\n coalesce(campaign_activities.clicks,0) as campaign_clicks,\n coalesce(campaign_activities.unique_opens,0) as campaign_unique_opens,\n coalesce(campaign_activities.unique_clicks,0) as campaign_unique_clicks,\n coalesce(campaign_activities.unsubscribes,0) as campaign_unsubscribes,\n lists.name as list_name\n\n from segments\n left join campaign_activities\n on segments.segment_id = campaign_activities.segment_id\n left join lists \n on segments.list_id = lists.list_id\n\n\n\n), automation_activities as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_activities_by_segment\n\n), metrics_xf as (\n\n select \n metrics.*,\n coalesce(automation_activities.sends,0) as automation_sends,\n coalesce(automation_activities.opens,0) as automation_opens,\n coalesce(automation_activities.clicks,0) as automation_clicks,\n coalesce(automation_activities.unique_opens,0) as automation_unique_opens,\n coalesce(automation_activities.unique_clicks,0) as automation_unique_clicks,\n coalesce(automation_activities.unsubscribes,0) as automation_unsubscribes\n from metrics\n left join automation_activities\n on metrics.segment_id = automation_activities.segment_id\n\n)\n\nselect *\nfrom metrics_xf\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "sql": " __dbt__cte__int_mailchimp__campaign_activities_by_segment as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_activities_by_segment", "sql": " __dbt__cte__int_mailchimp__automation_activities_by_segment as (\n\n\nwith activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": "`dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__segments`"}, "model.mailchimp.int_mailchimp__automation_activities_by_member": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_member"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_member", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_member.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_member.sql", "name": "int_mailchimp__automation_activities_by_member", "alias": "int_mailchimp__automation_activities_by_member", "checksum": {"name": "sha256", "checksum": "38ab3ac9ce7da18dff1e2c43677fb7c92abbfe0146cb192790097aefcadbce53"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_member.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.102112, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by member\n\n), pivoted as (\n\n select \n member_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n member_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n member_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.member_id, sends.member_id, unsubscribes_xf.member_id) as member_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.member_id = sends.member_id\n full outer join unsubscribes_xf\n on pivoted.member_id = unsubscribes_xf.member_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__members_by_list": {"raw_sql": "with members as (\n\n select *\n from {{ ref('mailchimp__members') }}\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__members"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__members_by_list"], "unique_id": "model.mailchimp.int_mailchimp__members_by_list", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__members_by_list.sql", "original_file_path": "models/intermediate/int_mailchimp__members_by_list.sql", "name": "int_mailchimp__members_by_list", "alias": "int_mailchimp__members_by_list", "checksum": {"name": "sha256", "checksum": "24d58444ec10913bf4231cc95d22748734e620e0553935cb44c8c2d0eeb1dadc"}, "tags": [], "refs": [["mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__members_by_list.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1642018188.1069, "compiled_sql": "with members as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__members`\n\n), by_list as (\n\n select \n list_id,\n count(*) as count_members,\n max(signup_timestamp) as most_recent_signup_timestamp\n from members \n group by 1\n\n)\n\nselect *\nfrom by_list", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_list": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_list"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_list", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_list.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_list.sql", "name": "int_mailchimp__automation_activities_by_list", "alias": "int_mailchimp__automation_activities_by_list", "checksum": {"name": "sha256", "checksum": "5f71eb8826497fb24a723727df3b704c25a247718c5cc490ef89b56db68460ac"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_list.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.108953, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by list\n\n), pivoted as (\n\n select \n list_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n list_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n list_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.list_id, sends.list_id, unsubscribes_xf.list_id) as list_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.list_id = sends.list_id\n full outer join unsubscribes_xf\n on pivoted.list_id = unsubscribes_xf.list_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_list": {"raw_sql": "with recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_list"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_list", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_list.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_list.sql", "name": "int_mailchimp__campaign_activities_by_list", "alias": "int_mailchimp__campaign_activities_by_list", "checksum": {"name": "sha256", "checksum": "60daae7c38b56f8e7c56af7e9cff177fb5ee9da88ab8e68fa16567c7f0abcfdc"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_list.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1642018188.1138701, "compiled_sql": "with recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n list_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_member": {"raw_sql": "with recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_member"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_member", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_member.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_member.sql", "name": "int_mailchimp__campaign_activities_by_member", "alias": "int_mailchimp__campaign_activities_by_member", "checksum": {"name": "sha256", "checksum": "0489310b8f640f0845c4ad9c02f3cef04463259abab6188dce74cc5a84fbe7d7"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_member.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1642018188.115913, "compiled_sql": "with recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n member_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_segment": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_segment"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_segment.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_segment.sql", "name": "int_mailchimp__campaign_activities_by_segment", "alias": "int_mailchimp__campaign_activities_by_segment", "checksum": {"name": "sha256", "checksum": "16906edebc87c9092d1e7f5a45ce744e192f1327225f3fc669cad50a157f773b"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_segment.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.117824, "compiled_sql": "\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n segment_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n where segment_id is not null\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_automation": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_automation"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_automation", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_automation.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_automation.sql", "name": "int_mailchimp__automation_activities_by_automation", "alias": "int_mailchimp__automation_activities_by_automation", "checksum": {"name": "sha256", "checksum": "8665b30393103b13f4afbe97ac787686b6c8152e3ac99551a1eb6375ced4323d"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_automation.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.122999, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by automation\n\n), pivoted as (\n\n select \n automation_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n automation_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_id, sends.automation_id, unsubscribes_xf.automation_id) as automation_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_id = sends.automation_id\n full outer join unsubscribes_xf\n on pivoted.automation_id = unsubscribes_xf.automation_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_email": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_email"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_email", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_email.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_email.sql", "name": "int_mailchimp__automation_activities_by_email", "alias": "int_mailchimp__automation_activities_by_email", "checksum": {"name": "sha256", "checksum": "b04d6d481f7834458dfca27b206c9ee852fc2c5db8b43c105ac8e3fe792df57e"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_email.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.128181, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by email\n\n), pivoted as (\n\n select \n automation_email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks\n from activities\n group by 1\n\n), sends as (\n\n select\n automation_email_id,\n count(*) as sends\n from recipients\n group by 1\n\n), unsubscribes_xf as (\n\n select\n campaign_id as automation_email_id,\n count(*) as unsubscribes\n from unsubscribes\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.automation_email_id, sends.automation_email_id, unsubscribes_xf.automation_email_id) as automation_email_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.automation_email_id = sends.automation_email_id\n full outer join unsubscribes_xf\n on pivoted.automation_email_id = unsubscribes_xf.automation_email_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_unsubscribes": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith unsubscribes as (\n\n select *\n from {{ var('unsubscribe') }}\n\n), automation_emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_unsubscribes"], "unique_id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__automation_unsubscribes.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_unsubscribes.sql", "name": "int_mailchimp__automation_unsubscribes", "alias": "int_mailchimp__automation_unsubscribes", "checksum": {"name": "sha256", "checksum": "4d8a69f68951c9ee8f4662ba7a68b7335905622b2c8ed2fe05d29a106a60df29"}, "tags": [], "refs": [["stg_mailchimp__unsubscribes"], ["stg_mailchimp__automation_emails"], ["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_unsubscribes.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.1331682, "compiled_sql": "\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_campaign": {"raw_sql": "with recipients as (\n\n select *\n from {{ ref('mailchimp__campaign_recipients')}}\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_campaign"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_campaign.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_campaign.sql", "name": "int_mailchimp__campaign_activities_by_campaign", "alias": "int_mailchimp__campaign_activities_by_campaign", "checksum": {"name": "sha256", "checksum": "d62ab7383aa326b7471819dbc384d6bbf6f4cce9d54985cdabd6c1847e6142cb"}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_campaign.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1642018188.139544, "compiled_sql": "with recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n\n), pivoted as (\n\n select \n campaign_id,\n count(*) as sends,\n sum(opens) as opens,\n sum(clicks) as clicks,\n count(distinct case when was_opened = True then member_id end) as unique_opens,\n count(distinct case when was_clicked = True then member_id end) as unique_clicks,\n count(distinct case when was_unsubscribed = True then member_id end) as unsubscribes\n from recipients\n group by 1\n \n)\n\nselect *\nfrom pivoted", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_recipients": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith recipients as (\n\n select *\n from {{ var('automation_recipient') }}\n\n), automation_emails as (\n\n select *\n from {{ var('automation_email') }}\n\n), automations as (\n\n select *\n from {{ var('automation') }}\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_recipients"], "unique_id": "model.mailchimp.int_mailchimp__automation_recipients", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__automation_recipients.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_recipients.sql", "name": "int_mailchimp__automation_recipients", "alias": "int_mailchimp__automation_recipients", "checksum": {"name": "sha256", "checksum": "1aa76bbe079c311f1e0d3282e626f9bd32afcd22ca8870ff40116541c6ab264a"}, "tags": [], "refs": [["stg_mailchimp__automation_recipients"], ["stg_mailchimp__automation_emails"], ["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.14146, "compiled_sql": "\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.mailchimp.int_mailchimp__automation_activities_by_segment": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith activities as (\n\n select *\n from {{ ref('mailchimp__automation_activities')}}\n\n), recipients as (\n\n select *\n from {{ ref('int_mailchimp__automation_recipients') }}\n\n), unsubscribes as (\n\n select *\n from {{ ref('int_mailchimp__automation_unsubscribes') }}\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__automation_activities", "model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__automation_activities_by_segment"], "unique_id": "model.mailchimp.int_mailchimp__automation_activities_by_segment", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__automation_activities_by_segment.sql", "original_file_path": "models/intermediate/int_mailchimp__automation_activities_by_segment.sql", "name": "int_mailchimp__automation_activities_by_segment", "alias": "int_mailchimp__automation_activities_by_segment", "checksum": {"name": "sha256", "checksum": "82a7ae9769543e2832a0b6436842cfa6298028bcfc8320027855171e21b15cdc"}, "tags": [], "refs": [["mailchimp__automation_activities"], ["int_mailchimp__automation_recipients"], ["int_mailchimp__automation_unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__automation_activities_by_segment.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral", "enabled": true}, "created_at": 1642018188.147827, "compiled_sql": "\n\nwith __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n),activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n\n), recipients as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_recipients\n\n), unsubscribes as (\n\n select *\n from __dbt__cte__int_mailchimp__automation_unsubscribes\n\n\n-- aggregate automation opens and clicks by segment\n\n), pivoted as (\n\n select \n segment_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then segment_id end) as unique_opens, \n count(distinct case when action_type = 'click' then segment_id end) as unique_clicks\n from activities\n where segment_id is not null\n group by 1\n\n), sends as (\n\n select\n segment_id,\n count(*) as sends\n from recipients\n where segment_id is not null\n group by 1\n\n), unsubscribes_xf as (\n\n select\n segment_id,\n count(*) as unsubscribes\n from unsubscribes\n where segment_id is not null\n group by 1\n\n), joined as (\n\n select\n coalesce(pivoted.segment_id, sends.segment_id, unsubscribes_xf.segment_id) as segment_id,\n pivoted.opens,\n pivoted.clicks,\n pivoted.unique_opens,\n pivoted.unique_clicks,\n sends.sends,\n unsubscribes_xf.unsubscribes\n from pivoted\n full outer join sends\n on pivoted.segment_id = sends.segment_id\n full outer join unsubscribes_xf\n on pivoted.segment_id = unsubscribes_xf.segment_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.mailchimp.int_mailchimp__automation_recipients", "sql": " __dbt__cte__int_mailchimp__automation_recipients as (\n\n\nwith recipients as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n recipients.*,\n automations.segment_id,\n automations.automation_id\n\n from recipients\n left join automation_emails\n on recipients.automation_email_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.mailchimp.int_mailchimp__automation_unsubscribes", "sql": " __dbt__cte__int_mailchimp__automation_unsubscribes as (\n\n\nwith unsubscribes as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n\n), automation_emails as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n\n), automations as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n\n), joined as (\n\n select \n unsubscribes.*,\n automations.segment_id,\n automations.automation_id\n\n from unsubscribes\n left join automation_emails\n on unsubscribes.campaign_id = automation_emails.automation_email_id\n left join automations\n on automation_emails.automation_id = automations.automation_id\n\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.mailchimp.int_mailchimp__campaign_activities_by_email": {"raw_sql": "with activities as (\n\n select *\n from {{ ref('mailchimp__campaign_activities')}}\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.mailchimp.mailchimp__campaign_activities"]}, "config": {"enabled": true, "alias": null, "schema": "mailchimp", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_renee_mailchimp", "fqn": ["mailchimp", "intermediate", "int_mailchimp__campaign_activities_by_email"], "unique_id": "model.mailchimp.int_mailchimp__campaign_activities_by_email", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "intermediate/int_mailchimp__campaign_activities_by_email.sql", "original_file_path": "models/intermediate/int_mailchimp__campaign_activities_by_email.sql", "name": "int_mailchimp__campaign_activities_by_email", "alias": "int_mailchimp__campaign_activities_by_email", "checksum": {"name": "sha256", "checksum": "02daffaef1924ed64cf15f7775e89262fc2e7435549c94b5d86b1fef5ceb099b"}, "tags": [], "refs": [["mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/intermediate/int_mailchimp__campaign_activities_by_email.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "mailchimp", "materialized": "ephemeral"}, "created_at": 1642018188.1529732, "compiled_sql": "with activities as (\n\n select *\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\n\n), pivoted as (\n\n select \n email_id,\n sum(case when action_type = 'open' then 1 end) as opens,\n sum(case when action_type = 'click' then 1 end) as clicks, \n count(distinct case when action_type = 'open' then member_id end) as unique_opens, \n count(distinct case when action_type = 'click' then member_id end) as unique_clicks,\n min(case when action_type = 'open' then activity_timestamp end) as first_open_timestamp,\n min(case when action_type = 'open' then time_since_send_minutes end) as time_to_open_minutes,\n min(case when action_type = 'open' then time_since_send_hours end) as time_to_open_hours,\n min(case when action_type = 'open' then time_since_send_days end) as time_to_open_days\n from activities\n group by 1\n \n), booleans as (\n\n select \n *,\n case when opens > 0 then True else False end as was_opened,\n case when clicks > 0 then True else False end as was_clicked\n from pivoted\n\n)\n\nselect *\nfrom booleans", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_activities_activity_id", "alias": "not_null_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.32009, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__automation_activities"}, "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_activities_activity_id", "alias": "unique_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.321843, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select activity_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\n where activity_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__automation_activities"}, "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_emails')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_emails_automation_email_id", "alias": "unique_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.323584, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select automation_email_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\n where automation_email_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id", "file_key_name": "models.stg_mailchimp__automation_emails"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_emails')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_emails_automation_email_id", "alias": "not_null_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.3253682, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\nwhere automation_email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id", "file_key_name": "models.stg_mailchimp__automation_emails"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154\") }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_recipient_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154"}, "created_at": 1642018188.3270268, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\nwhere automation_recipient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id", "file_key_name": "models.stg_mailchimp__automation_recipients"}, "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db\") }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_recipient_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db"}, "created_at": 1642018188.328776, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select automation_recipient_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\n where automation_recipient_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id", "file_key_name": "models.stg_mailchimp__automation_recipients"}, "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automations')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automations_automation_id", "alias": "unique_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.330914, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select automation_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\n where automation_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id", "file_key_name": "models.stg_mailchimp__automations"}, "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automations')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automations_automation_id", "alias": "not_null_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.332531, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\nwhere automation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id", "file_key_name": "models.stg_mailchimp__automations"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_recipients_email_id", "alias": "unique_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.334147, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select email_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\n where email_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id", "file_key_name": "models.stg_mailchimp__campaign_recipients"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_recipients_email_id", "alias": "not_null_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.335822, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\nwhere email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id", "file_key_name": "models.stg_mailchimp__campaign_recipients"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_activities_activity_id", "alias": "unique_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.337646, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select activity_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\n where activity_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__campaign_activities"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_activities_activity_id", "alias": "not_null_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.339254, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__campaign_activities"}, "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaigns')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaigns_campaign_id", "alias": "unique_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.3409548, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select campaign_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\n where campaign_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.stg_mailchimp__campaigns"}, "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaigns')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaigns_campaign_id", "alias": "not_null_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.342745, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\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_mailchimp__campaigns"}, "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__lists')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__lists_list_id", "alias": "unique_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.344696, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select list_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\n where list_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id", "file_key_name": "models.stg_mailchimp__lists"}, "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__lists')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__lists_list_id", "alias": "not_null_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.346296, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id", "file_key_name": "models.stg_mailchimp__lists"}, "test.mailchimp_source.unique_stg_mailchimp__members_list_member_id.5ff17f888f": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "list_member_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__members_list_member_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_list_member_id.5ff17f888f", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__members_list_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__members_list_member_id", "alias": "unique_stg_mailchimp__members_list_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__members_list_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.347902, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select list_member_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\n where list_member_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_member_id", "file_key_name": "models.stg_mailchimp__members"}, "test.mailchimp_source.not_null_stg_mailchimp__members_list_member_id.5079cadaf2": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_member_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__members_list_member_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_list_member_id.5079cadaf2", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__members_list_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__members_list_member_id", "alias": "not_null_stg_mailchimp__members_list_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__members_list_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.349503, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\nwhere list_member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_member_id", "file_key_name": "models.stg_mailchimp__members"}, "test.mailchimp_source.unique_stg_mailchimp__segment_members_segment_member_id.545e7c979a": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "segment_member_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__segment_members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__segment_members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__segment_members_segment_member_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segment_members_segment_member_id.545e7c979a", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__segment_members_segment_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__segment_members_segment_member_id", "alias": "unique_stg_mailchimp__segment_members_segment_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__segment_members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__segment_members_segment_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.3513658, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select segment_member_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members`\n where segment_member_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_member_id", "file_key_name": "models.stg_mailchimp__segment_members"}, "test.mailchimp_source.not_null_stg_mailchimp__segment_members_segment_member_id.fcd8f8c3d8": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "segment_member_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__segment_members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__segment_members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__segment_members_segment_member_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segment_members_segment_member_id.fcd8f8c3d8", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__segment_members_segment_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__segment_members_segment_member_id", "alias": "not_null_stg_mailchimp__segment_members_segment_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__segment_members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__segment_members_segment_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.352968, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members`\nwhere segment_member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_member_id", "file_key_name": "models.stg_mailchimp__segment_members"}, "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "segment_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__segments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__segments_segment_id", "alias": "unique_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.3545752, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select segment_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\n where segment_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id", "file_key_name": "models.stg_mailchimp__segments"}, "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "segment_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__segments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__segments_segment_id", "alias": "not_null_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.356181, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\nwhere segment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id", "file_key_name": "models.stg_mailchimp__segments"}, "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unsubscribe_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__unsubscribes')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.358059, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\nwhere unsubscribe_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id", "file_key_name": "models.stg_mailchimp__unsubscribes"}, "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unsubscribe_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__unsubscribes')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.3596978, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select unsubscribe_id as unique_field\n from `dbt-package-testing`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\n where unsubscribe_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id", "file_key_name": "models.stg_mailchimp__unsubscribes"}, "test.mailchimp.unique_mailchimp__lists_list_id.02d919c4b7": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('mailchimp__lists')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__lists"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__lists_list_id"], "unique_id": "test.mailchimp.unique_mailchimp__lists_list_id.02d919c4b7", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__lists_list_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__lists_list_id", "alias": "unique_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.495223, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select list_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__lists`\n where list_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id", "file_key_name": "models.mailchimp__lists"}, "test.mailchimp.not_null_mailchimp__lists_list_id.310995cf61": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('mailchimp__lists')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__lists"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__lists_list_id"], "unique_id": "test.mailchimp.not_null_mailchimp__lists_list_id.310995cf61", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__lists_list_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__lists_list_id", "alias": "not_null_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.497016, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__lists`\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id", "file_key_name": "models.mailchimp__lists"}, "test.mailchimp.unique_mailchimp__members_list_member_id.41741e9b6e": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "list_member_id", "model": "{{ get_where_subquery(ref('mailchimp__members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__members_list_member_id"], "unique_id": "test.mailchimp.unique_mailchimp__members_list_member_id.41741e9b6e", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__members_list_member_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__members_list_member_id", "alias": "unique_mailchimp__members_list_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__members_list_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.4988182, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select list_member_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__members`\n where list_member_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_member_id", "file_key_name": "models.mailchimp__members"}, "test.mailchimp.not_null_mailchimp__members_list_member_id.aac183787a": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_member_id", "model": "{{ get_where_subquery(ref('mailchimp__members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__members_list_member_id"], "unique_id": "test.mailchimp.not_null_mailchimp__members_list_member_id.aac183787a", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__members_list_member_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__members_list_member_id", "alias": "not_null_mailchimp__members_list_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__members_list_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.500451, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__members`\nwhere list_member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_member_id", "file_key_name": "models.mailchimp__members"}, "test.mailchimp.unique_mailchimp__campaigns_campaign_id.eb6be29df4": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('mailchimp__campaigns')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp.unique_mailchimp__campaigns_campaign_id.eb6be29df4", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__campaigns_campaign_id", "alias": "unique_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.502145, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select campaign_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaigns`\n where campaign_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.mailchimp__campaigns"}, "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.809cc27175": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('mailchimp__campaigns')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.809cc27175", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__campaigns_campaign_id", "alias": "not_null_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.503957, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaigns`\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.mailchimp__campaigns"}, "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.9c859c5286": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "email_id", "model": "{{ get_where_subquery(ref('mailchimp__campaign_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.9c859c5286", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__campaign_recipients_email_id", "alias": "unique_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.5056388, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select email_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\n where email_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id", "file_key_name": "models.mailchimp__campaign_recipients"}, "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.0ae99b3cf9": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email_id", "model": "{{ get_where_subquery(ref('mailchimp__campaign_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.0ae99b3cf9", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__campaign_recipients_email_id", "alias": "not_null_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.507277, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_recipients`\nwhere email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id", "file_key_name": "models.mailchimp__campaign_recipients"}, "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.8a67feefd5": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('mailchimp__campaign_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__campaign_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.8a67feefd5", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__campaign_activities_activity_id", "alias": "unique_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.5089102, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select activity_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\n where activity_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.mailchimp__campaign_activities"}, "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.358cb1d1f6": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('mailchimp__campaign_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__campaign_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.358cb1d1f6", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__campaign_activities_activity_id", "alias": "not_null_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.51073, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__campaign_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.mailchimp__campaign_activities"}, "test.mailchimp.unique_mailchimp__automations_automation_id.a3de618dee": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_id", "model": "{{ get_where_subquery(ref('mailchimp__automations')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp.unique_mailchimp__automations_automation_id.a3de618dee", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__automations_automation_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__automations_automation_id", "alias": "unique_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.512465, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select automation_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automations`\n where automation_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id", "file_key_name": "models.mailchimp__automations"}, "test.mailchimp.not_null_mailchimp__automations_automation_id.99246c168e": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_id", "model": "{{ get_where_subquery(ref('mailchimp__automations')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp.not_null_mailchimp__automations_automation_id.99246c168e", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__automations_automation_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__automations_automation_id", "alias": "not_null_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.514099, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automations`\nwhere automation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id", "file_key_name": "models.mailchimp__automations"}, "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.ac05084851": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_email_id", "model": "{{ get_where_subquery(ref('mailchimp__automation_emails')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__automation_emails"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.ac05084851", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__automation_emails_automation_email_id", "alias": "unique_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.5157351, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select automation_email_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_emails`\n where automation_email_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id", "file_key_name": "models.mailchimp__automation_emails"}, "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.b6ed84cd9c": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_email_id", "model": "{{ get_where_subquery(ref('mailchimp__automation_emails')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__automation_emails"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.b6ed84cd9c", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__automation_emails_automation_email_id", "alias": "not_null_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.5177002, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_emails`\nwhere automation_email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id", "file_key_name": "models.mailchimp__automation_emails"}, "test.mailchimp.unique_mailchimp__automation_activities_activity_id.e455285fa8": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('mailchimp__automation_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__automation_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp.unique_mailchimp__automation_activities_activity_id.e455285fa8", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__automation_activities_activity_id", "alias": "unique_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.5193431, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select activity_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\n where activity_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.mailchimp__automation_activities"}, "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.e225bd7be1": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('mailchimp__automation_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__automation_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.e225bd7be1", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__automation_activities_activity_id", "alias": "not_null_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.521009, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__automation_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.mailchimp__automation_activities"}, "test.mailchimp.unique_mailchimp__segments_segment_id.b104dc2fe7": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "segment_id", "model": "{{ get_where_subquery(ref('mailchimp__segments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__segments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "unique_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp.unique_mailchimp__segments_segment_id.b104dc2fe7", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "unique_mailchimp__segments_segment_id.sql", "original_file_path": "models/mailchimp.yml", "name": "unique_mailchimp__segments_segment_id", "alias": "unique_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/unique_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.522639, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select segment_id as unique_field\n from `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__segments`\n where segment_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id", "file_key_name": "models.mailchimp__segments"}, "test.mailchimp.not_null_mailchimp__segments_segment_id.26bfa1b782": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "segment_id", "model": "{{ get_where_subquery(ref('mailchimp__segments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp.mailchimp__segments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp", "not_null_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp.not_null_mailchimp__segments_segment_id.26bfa1b782", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "not_null_mailchimp__segments_segment_id.sql", "original_file_path": "models/mailchimp.yml", "name": "not_null_mailchimp__segments_segment_id", "alias": "not_null_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp/models/mailchimp.yml/not_null_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1642018188.524466, "compiled_sql": "\n \n \n\nselect *\nfrom `dbt-package-testing`.`dbt_renee_mailchimp`.`mailchimp__segments`\nwhere segment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id", "file_key_name": "models.mailchimp__segments"}}, "sources": {"source.mailchimp_source.mailchimp.automation": {"fqn": ["mailchimp_source", "mailchimp", "automation"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`automation`", "created_at": 1642018188.525577}, "source.mailchimp_source.mailchimp.automation_email": {"fqn": ["mailchimp_source", "mailchimp", "automation_email"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_email", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_email", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_email", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation email (that make up automations).", "columns": {"id": {"name": "id", "description": "The ID of the email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`automation_email`", "created_at": 1642018188.525805}, "source.mailchimp_source.mailchimp.automation_recipient": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents info about the recipient of each automation.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`automation_recipient`", "created_at": 1642018188.525951}, "source.mailchimp_source.mailchimp.automation_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient_activity"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`automation_recipient_activity`", "created_at": 1642018188.5261009}, "source.mailchimp_source.mailchimp.campaign": {"fqn": ["mailchimp_source", "mailchimp", "campaign"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a campaign in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`campaign`", "created_at": 1642018188.526303}, "source.mailchimp_source.mailchimp.campaign_recipient": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents the send of a campaign email.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`campaign_recipient`", "created_at": 1642018188.526444}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient_activity"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`campaign_recipient_activity`", "created_at": 1642018188.526591}, "source.mailchimp_source.mailchimp.segment": {"fqn": ["mailchimp_source", "mailchimp", "segment"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.segment", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a segment in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`segment`", "created_at": 1642018188.526735}, "source.mailchimp_source.mailchimp.segment_member": {"fqn": ["mailchimp_source", "mailchimp", "segment_member"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.segment_member", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment_member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment_member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member and their segment data.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`segment_member`", "created_at": 1642018188.526873}, "source.mailchimp_source.mailchimp.list": {"fqn": ["mailchimp_source", "mailchimp", "list"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.list", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "list", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "list", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a list in Mailchimp.", "columns": {"id": {"name": "id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`list`", "created_at": 1642018188.527046}, "source.mailchimp_source.mailchimp.member": {"fqn": ["mailchimp_source", "mailchimp", "member"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.member", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member in Mailchimp. Note that this table may contain custom metadata columns which can be passed through via `mailchimp__members_pass_through_columns`.\n", "columns": {"id": {"name": "id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_signup": {"name": "timestamp_signup", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_opt": {"name": "timestamp_opt", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed": {"name": "last_changed", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_opt": {"name": "ip_opt", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_signup": {"name": "ip_signup", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`member`", "created_at": 1642018188.527213}, "source.mailchimp_source.mailchimp.unsubscribe": {"fqn": ["mailchimp_source", "mailchimp", "unsubscribe"], "database": "dbt-package-testing", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.unsubscribe", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "unsubscribe", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "unsubscribe", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member who unsubscribed.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`mailchimp`.`unsubscribe`", "created_at": 1642018188.527352}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.444538}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.445238}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4458811}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4514592}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.460856}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.461979}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.462852}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4635048}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.465067}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.465642}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4664059}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4667258}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.467036}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.467603}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.468077}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.468471}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.468673}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4691}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.469456}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.469897}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.470592}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4709811}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.471359}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.472332}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.473242}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.474894}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n \n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.475266}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.476057}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.476416}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4777331}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.478891}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4801621}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.48383}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.48687}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.490051}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.491009}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n \n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.496377}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.4998348}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5094259}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.511413}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5118852}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5123599}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.51525}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.515724}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5160792}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.516742}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.51724}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.518178}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.518937}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.519639}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.520582}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.521183}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5282218}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.528809}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5294368}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.529984}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5302432}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.532136}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.532598}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5330272}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\n {%- set ns = namespace() -%} {# handle for-loop scoping with a namespace #}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.535407}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = config.get('updated_at', snapshot_string_as_time(now)) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.540172}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.545568}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.546442}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.546998}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5472572}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.547848}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.55022}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.550675}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.551292}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.552315}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_sql']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.565185}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.570327}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.571724}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.572798}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5739782}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.574892}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n \n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.576663}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.578055}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }} \n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5795121}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5854552}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5888572}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.5894752}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.590554}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.591274}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.592811}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.594348}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {% set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\n \n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.604505}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6131048}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6164742}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.619753}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n \n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n \n {% if schema_changes_dict['schema_changed'] %}\n \n {% if on_schema_change == 'fail' %}\n \n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways: \n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n \n {% do exceptions.raise_compiler_error(fail_msg) %}\n \n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n \n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {% endif %}\n \n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6214862}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.63108}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.632535}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.633108}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.633742}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n \n {{ sql_header if sql_header is not none }}\n \n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.634878}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"old_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.647608}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6485949}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6491451}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6524348}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6533692}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.653776}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.654229}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.65487}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.661632}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6681511}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.670277}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.67079}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6718879}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6722019}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.672457}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.672804}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.673076}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.674129}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6745322}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.67728}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.678198}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.678693}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.679755}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.680342}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.680982}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.681922}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.682498}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.683296}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.683796}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.684427}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.685916}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.688129}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.68936}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.690012}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.693132}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.695782}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.697424}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.697922}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.698922}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.699324}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.6996748}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.70007}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7010481}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.701516}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.701968}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.70293}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7055712}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.706225}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7066638}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.707127}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7075222}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.707874}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.708425}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.709036}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7097511}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.710927}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7114189}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.711843}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7127712}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.713087}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7135758}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7144718}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.715735}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.716098}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7166002}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.716972}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.717598}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.718624}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.721005}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7215629}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.721971}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7223082}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7227}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7232409}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.723688}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.724489}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7249181}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.72527}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.728207}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.72855}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7294762}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.72991}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.73085}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.731344}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.732726}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.733417}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7352178}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.73629}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7368078}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.737609}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7382982}, "macro.mailchimp_source.get_automation_recipient_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_automation_recipient_columns.sql", "original_file_path": "macros/get_automation_recipient_columns.sql", "name": "get_automation_recipient_columns", "macro_sql": "{% macro get_automation_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.739672}, "macro.mailchimp_source.get_campaign_columns": {"unique_id": "macro.mailchimp_source.get_campaign_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_campaign_columns.sql", "original_file_path": "macros/get_campaign_columns.sql", "name": "get_campaign_columns", "macro_sql": "{% macro get_campaign_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"clicktale\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"content_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"long_archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reply_to\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"send_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"test_size\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timewarp\", \"datatype\": \"boolean\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_conversation\", \"datatype\": \"boolean\"},\n {\"name\": \"wait_time\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winner_criteria\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winning_campaign_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winning_combination_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.749075}, "macro.mailchimp_source.get_list_columns": {"unique_id": "macro.mailchimp_source.get_list_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_list_columns.sql", "original_file_path": "macros/get_list_columns.sql", "name": "get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"beamer_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_address_2\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"contact_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_created\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"default_from_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_language\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_subject\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"email_type_option\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_rating\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"notify_on_subscribe\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"notify_on_unsubscribe\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"permission_reminder\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscribe_url_long\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscribe_url_short\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_archive_bar\", \"datatype\": \"boolean\"},\n {\"name\": \"visibility\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7558641}, "macro.mailchimp_source.get_segment_columns": {"unique_id": "macro.mailchimp_source.get_segment_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_segment_columns.sql", "original_file_path": "macros/get_segment_columns.sql", "name": "get_segment_columns", "macro_sql": "{% macro get_segment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_count\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.758979}, "macro.mailchimp_source.get_automation_email_columns": {"unique_id": "macro.mailchimp_source.get_automation_email_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_automation_email_columns.sql", "original_file_path": "macros/get_automation_email_columns.sql", "name": "get_automation_email_columns", "macro_sql": "{% macro get_automation_email_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"automation_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"clicktale\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"content_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"delay_action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_action_description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_amount\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"delay_direction\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"delay_full_description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"position\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"reply_to\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"send_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"start_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timewarp\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"use_conversation\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.770987}, "macro.mailchimp_source.get_member_columns": {"unique_id": "macro.mailchimp_source.get_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_member_columns.sql", "original_file_path": "macros/get_member_columns.sql", "name": "get_member_columns", "macro_sql": "{% macro get_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"dstoff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"email_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_client\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"gmtoff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ip_opt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ip_signup\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"language\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"last_changed\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"latitude\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"longitude\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"member_rating\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp_opt\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"timestamp_signup\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"timezone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unique_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vip\", \"datatype\": \"boolean\"}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('mailchimp__members_pass_through_columns')) }}\n\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float", "macro.dbt_utils.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.778023}, "macro.mailchimp_source.get_automation_columns": {"unique_id": "macro.mailchimp_source.get_automation_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_automation_columns.sql", "original_file_path": "macros/get_automation_columns.sql", "name": "get_automation_columns", "macro_sql": "{% macro get_automation_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"start_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"trigger_settings\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7807841}, "macro.mailchimp_source.get_campaign_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_campaign_recipient_activity_columns.sql", "original_file_path": "macros/get_campaign_recipient_activity_columns.sql", "name": "get_campaign_recipient_activity_columns", "macro_sql": "{% macro get_campaign_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.783371}, "macro.mailchimp_source.get_campaign_recipient_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_campaign_recipient_columns.sql", "original_file_path": "macros/get_campaign_recipient_columns.sql", "name": "get_campaign_recipient_columns", "macro_sql": "{% macro get_campaign_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.784925}, "macro.mailchimp_source.get_unsubscribe_columns": {"unique_id": "macro.mailchimp_source.get_unsubscribe_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_unsubscribe_columns.sql", "original_file_path": "macros/get_unsubscribe_columns.sql", "name": "get_unsubscribe_columns", "macro_sql": "{% macro get_unsubscribe_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.78671}, "macro.mailchimp_source.get_segment_member_columns": {"unique_id": "macro.mailchimp_source.get_segment_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_segment_member_columns.sql", "original_file_path": "macros/get_segment_member_columns.sql", "name": "get_segment_member_columns", "macro_sql": "{% macro get_segment_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.788256}, "macro.mailchimp_source.get_automation_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp_source", "path": "macros/get_automation_recipient_activity_columns.sql", "original_file_path": "macros/get_automation_recipient_activity_columns.sql", "name": "get_automation_recipient_activity_columns", "macro_sql": "{% macro get_automation_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.790609}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.791252}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.791422}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.791622}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.792546}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.792906}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.793584}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.793876}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.795306}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7954738}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.795637}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.795797}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.795956}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7963}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7964642}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.796729}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.797079}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7972429}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7974021}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.797836}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.798005}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.79817}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.798534}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.798698}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.798858}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.7991989}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.799362}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.79952}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.800579}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.801318}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.801553}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.80178}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8029199}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.803303}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.80368}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.80404}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.804485}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.805115}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8052852}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.805451}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.806771}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.807071}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.807435}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8077838}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.811903}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.812271}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.812623}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.81645}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) %}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.816894}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.817718}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.818094}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.818378}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.818659}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8193579}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.819663}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.819946}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.820663}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.820971}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8212469}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.822402}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.822633}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.822855}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.823762}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.824065}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.824472}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.825166}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8254468}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.826817}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.827064}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8272262}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8273861}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.827731}, "macro.dbt_utils.default__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8279738}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8283389}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.828585}, "macro.dbt_utils.redshift__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.redshift__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.828871}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.831222}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.832264}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.833259}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8336809}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8347971}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.835364}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.835683}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.836525}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.836906}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.837822}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.838461}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8388438}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8400362}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8403971}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.840682}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.842412}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.851346}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.852438}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.853119}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.854267}, "macro.dbt_utils.materialization_insert_by_period_default": {"unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}}\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.866046}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.866882}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8678799}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.868948}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt_utils.position", "macro.dbt_utils.split_part", "macro.dbt_utils.right", "macro.dbt_utils.length", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.870346}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.871126}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8718421}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.872535}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.872891}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.87358}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8739982}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.874648}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.87502}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.876101}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.877137}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model) %}\n\n{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}\n\nwith a as (\n\n select count(*) as count_our_model from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparison_model from {{ compare_model }}\n\n),\ncounts as (\n\n select\n count_our_model,\n count_comparison_model\n from a\n cross join b\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.877609}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8791611}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'coalesce(diff_count, 0)') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n from a\n cross join b\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.880338}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.882984}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.884638}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.886662}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval) %}\n\n{% set threshold = dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp()) %}\n\nwith recency as (\n\n select max({{field}}) as most_recent\n from {{ model }}\n\n)\n\nselect\n\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.888351}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.889663}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name) %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8901172}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.891789}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.893427}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.8950012}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.896615}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.898365}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.899331}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.901025}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name) %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.901835}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.904914}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.907657}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.909941}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.911645}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9130108}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n *\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.913742}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.914794}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\nwith validation as (\n select\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n),\nvalidation_errors as (\n select\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9160588}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.918307}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as previous_{{ column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = previous_{{ column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.920663}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9219131}, "macro.dbt_utils.default__test_not_null_where": {"unique_id": "macro.dbt_utils.default__test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.922409}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.924049}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9261389}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.931382}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.934818}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9366488}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.datediff(start_date, end_date, datepart)}}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.93802}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.938619}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\n\n*/\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt_utils.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9395661}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.940533}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.941472}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.943085}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.944982}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9465191}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9474502}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.947884}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.949056}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9504519}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.95254}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.953558}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.954189}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.955696}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.958831}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.962185}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.type_string", "macro.dbt_utils.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9670699}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.970168}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.975706}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.989871}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.990873}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9924579}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\n\n {%- set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- set _ = fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.hash", "macro.dbt_utils.concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9949372}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.996337}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.997062}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.9980328}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018186.998962}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0026612}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.00354}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as table_type\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0052428}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.006637}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.009464}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n{% if default is none %}\n {% set default = [] %}\n{% endif %}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return(default) }}\n {% endif %}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.013061}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0152252}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for v in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ v ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.017246}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.018275}, "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/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.019595}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.021429}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.022062}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.023416}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.02531}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0263}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.02789}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0282629}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.028634}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.028996}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.029321}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0296829}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.030692}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0321841}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.03519}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.035996}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.037249}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0379891}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.038765}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0397499}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.040637}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0419142}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.04219}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.042474}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0427551}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0439072}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.045761}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.047725}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.049485}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0501041}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0506802}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0511959}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.05189}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.057535}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0579572}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.058367}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.058967}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0633621}, "macro.fivetran_utils.generate_columns_macro": {"unique_id": "macro.fivetran_utils.generate_columns_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/generate_columns_macro.sql", "original_file_path": "macros/generate_columns_macro.sql", "name": "generate_columns_macro", "macro_sql": "{% macro generate_columns_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set columns = get_columns_for_macro(table_name, schema_name, database_name) %}\n\n{% set jinja_macro=[] %}\n\n{% do jinja_macro.append('{% macro get_' ~ table_name ~ '_columns() %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% set columns = [') %}\n\n{% for col in columns %}\n{% do jinja_macro.append(' ' ~ col ~ (',' if not loop.last)) %}\n{% endfor %}\n\n{% do jinja_macro.append('] %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{{ return(columns) }}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% endmacro %}') %}\n\n{% if execute %}\n\n {% set joined = jinja_macro | join ('\\n') %}\n {{ log(joined, info=True) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.06725}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0688052}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt_utils.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.070723}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.072294}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.072949}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0736399}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.074605}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0770009}, "macro.fivetran_utils.staging_models_automation": {"unique_id": "macro.fivetran_utils.staging_models_automation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/staging_models_automation.sql", "original_file_path": "macros/staging_models_automation.sql", "name": "staging_models_automation", "macro_sql": "{% macro staging_models_automation(package, source_schema, source_database, tables) %}\n\n{% set package = \"\"~ package ~\"\" %}\n{% set source_schema = \"\"~ source_schema ~\"\" %}\n{% set source_database = \"\"~ source_database ~\"\" %}\n\n{% set zsh_command = \"source dbt_modules/fivetran_utils/columns_setup.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n\n{% for t in tables %}\n {% if t != tables[-1] %}\n {% set help_command = zsh_command + t + \" && \\n\" %}\n\n {% else %}\n {% set help_command = zsh_command + t %}\n\n {% endif %}\n {{ log(help_command, info=True) }}\n\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.0797281}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.089644}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.090666}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.092195}, "macro.fivetran_utils.default__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.default__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "default__get_columns_for_macro", "macro_sql": "{% macro default__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'text' then 'dbt_utils.type_string()' \n when lower(data_type) = 'boolean' then '\"boolean\"'\n when lower(data_type) = 'number' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float' then 'dbt_utils.type_float()' \n when lower(data_type) = 'date' then '\"date\"'\n end,\n '}')\nfrom {{ database_name }}.information_schema.columns\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.094901}, "macro.fivetran_utils.bigquery__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.bigquery__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "bigquery__get_columns_for_macro", "macro_sql": "{% macro bigquery__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'string' then 'dbt_utils.type_string()' \n when lower(data_type) = 'bool' then '\"boolean\"'\n when lower(data_type) = 'numeric' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float64' then 'dbt_utils.type_float()' \n when lower(data_type) = 'int64' then 'dbt_utils.type_int()' \n when lower(data_type) = 'date' then '\"date\"' \n when lower(data_type) = 'datetime' then '\"datetime\"' \n end,\n '}')\nfrom `{{ database_name }}`.{{ schema_name }}.INFORMATION_SCHEMA.COLUMNS\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.096283}, "macro.fivetran_utils.get_columns_for_macro": {"unique_id": "macro.fivetran_utils.get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "get_columns_for_macro", "macro_sql": "{% macro get_columns_for_macro(table_name, schema_name, database_name) -%}\n {{ return(adapter.dispatch('get_columns_for_macro')(table_name, schema_name, database_name)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.096829}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1001549}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.101553}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.102955}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.103471}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.103998}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1045172}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.104987}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.105462}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.107012}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.name == source.name %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.109372}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.110833}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.111238}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.111657}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1123729}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.113125}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1136892}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1148648}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1152709}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1156611}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1172218}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1197}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.124372}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.12768}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1285481}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.12879}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.129025}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1300008}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1642018187.1309922}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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/overview)?\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"}, "mailchimp.campaign_sends": {"unique_id": "mailchimp.campaign_sends", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_sends", "block_contents": "The number of sent emails from campaigns."}, "mailchimp.campaign_opens": {"unique_id": "mailchimp.campaign_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_opens", "block_contents": "The number of open events from campaign emails. \nThe same email being opened multiple times is included in this metric."}, "mailchimp.campaign_clicks": {"unique_id": "mailchimp.campaign_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_clicks", "block_contents": "The number of click events from campaign emails. \nThe same email being clicked multiple times is included in this metric."}, "mailchimp.campaign_unique_opens": {"unique_id": "mailchimp.campaign_unique_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_unique_opens", "block_contents": "The unique number of emails opened from campaign emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp."}, "mailchimp.campaign_unique_clicks": {"unique_id": "mailchimp.campaign_unique_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_unique_clicks", "block_contents": "The unique number of emails clicked from campaign emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp."}, "mailchimp.campaign_unsubscribes": {"unique_id": "mailchimp.campaign_unsubscribes", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "campaign_unsubscribes", "block_contents": "The number of users who have unsubscribed from campaign emails."}, "mailchimp.automation_sends": {"unique_id": "mailchimp.automation_sends", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_sends", "block_contents": "The number of sent emails from automations."}, "mailchimp.automation_opens": {"unique_id": "mailchimp.automation_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_opens", "block_contents": "The number of open events from automation emails. \nThe same email being opened multiple times is included in this metric."}, "mailchimp.automation_clicks": {"unique_id": "mailchimp.automation_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_clicks", "block_contents": "The number of click events from automation emails. \nThe same email being clicked multiple times is included in this metric."}, "mailchimp.automation_unique_opens": {"unique_id": "mailchimp.automation_unique_opens", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_unique_opens", "block_contents": "The unique number of emails opened from automation emails. \nIf a given email to a user was opened multiple times, it will only count once in this metric.\nThis is the metric for opens that is reported by Mailchimp."}, "mailchimp.automation_unique_clicks": {"unique_id": "mailchimp.automation_unique_clicks", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_unique_clicks", "block_contents": "The unique number of emails clicked from automation emails. \nIf a given email to a user was clicked multiple times, it will only count once in this metric.\nThis is the metric for clicks that is reported by Mailchimp."}, "mailchimp.automation_unsubscribes": {"unique_id": "mailchimp.automation_unsubscribes", "package_name": "mailchimp", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_packages/mailchimp", "path": "mailchimp.md", "original_file_path": "models/mailchimp.md", "name": "automation_unsubscribes", "block_contents": "The number of users who have unsubscribed from automation emails."}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.mailchimp_source.stg_mailchimp__segments": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__lists": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"], "model.mailchimp_source.stg_mailchimp__campaigns": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "model.mailchimp_source.stg_mailchimp__automations": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__members": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "model.mailchimp_source.stg_mailchimp__segment_members": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["source.mailchimp_source.mailchimp.automation_recipient_activity"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["source.mailchimp_source.mailchimp.unsubscribe"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["source.mailchimp_source.mailchimp.list"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["source.mailchimp_source.mailchimp.segment"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["source.mailchimp_source.mailchimp.campaign"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["source.mailchimp_source.mailchimp.segment_member"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["source.mailchimp_source.mailchimp.member"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["source.mailchimp_source.mailchimp.automation"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["source.mailchimp_source.mailchimp.automation_email"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["source.mailchimp_source.mailchimp.automation_recipient"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"], "model.mailchimp.mailchimp__automation_activities": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.mailchimp__lists": ["model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__campaign_activities_by_list", "model.mailchimp.int_mailchimp__members_by_list", "model.mailchimp_source.stg_mailchimp__lists"], "model.mailchimp.mailchimp__members": ["model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__campaign_activities_by_member", "model.mailchimp_source.stg_mailchimp__members"], "model.mailchimp.mailchimp__campaigns": ["model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp.mailchimp__campaign_activities": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp.mailchimp__campaign_recipients": ["model.mailchimp.int_mailchimp__campaign_activities_by_email", "model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp.mailchimp__automations": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.mailchimp__automation_emails": ["model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.mailchimp__segments": ["model.mailchimp.int_mailchimp__automation_activities_by_segment", "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp_source.stg_mailchimp__segments"], "model.mailchimp.int_mailchimp__automation_activities_by_member": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__members_by_list": ["model.mailchimp.mailchimp__members"], "model.mailchimp.int_mailchimp__automation_activities_by_list": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__campaign_activities_by_list": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__campaign_activities_by_member": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__campaign_activities_by_segment": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__automation_activities_by_automation": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__automation_activities_by_email": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__automation_unsubscribes": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp.int_mailchimp__campaign_activities_by_campaign": ["model.mailchimp.mailchimp__campaign_recipients"], "model.mailchimp.int_mailchimp__automation_recipients": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp.int_mailchimp__automation_activities_by_segment": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities"], "model.mailchimp.int_mailchimp__campaign_activities_by_email": ["model.mailchimp.mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.unique_stg_mailchimp__members_list_member_id.5ff17f888f": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.not_null_stg_mailchimp__members_list_member_id.5079cadaf2": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.unique_stg_mailchimp__segment_members_segment_member_id.545e7c979a": ["model.mailchimp_source.stg_mailchimp__segment_members"], "test.mailchimp_source.not_null_stg_mailchimp__segment_members_segment_member_id.fcd8f8c3d8": ["model.mailchimp_source.stg_mailchimp__segment_members"], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "test.mailchimp.unique_mailchimp__lists_list_id.02d919c4b7": ["model.mailchimp.mailchimp__lists"], "test.mailchimp.not_null_mailchimp__lists_list_id.310995cf61": ["model.mailchimp.mailchimp__lists"], "test.mailchimp.unique_mailchimp__members_list_member_id.41741e9b6e": ["model.mailchimp.mailchimp__members"], "test.mailchimp.not_null_mailchimp__members_list_member_id.aac183787a": ["model.mailchimp.mailchimp__members"], "test.mailchimp.unique_mailchimp__campaigns_campaign_id.eb6be29df4": ["model.mailchimp.mailchimp__campaigns"], "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.809cc27175": ["model.mailchimp.mailchimp__campaigns"], "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.9c859c5286": ["model.mailchimp.mailchimp__campaign_recipients"], "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.0ae99b3cf9": ["model.mailchimp.mailchimp__campaign_recipients"], "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.8a67feefd5": ["model.mailchimp.mailchimp__campaign_activities"], "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.358cb1d1f6": ["model.mailchimp.mailchimp__campaign_activities"], "test.mailchimp.unique_mailchimp__automations_automation_id.a3de618dee": ["model.mailchimp.mailchimp__automations"], "test.mailchimp.not_null_mailchimp__automations_automation_id.99246c168e": ["model.mailchimp.mailchimp__automations"], "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.ac05084851": ["model.mailchimp.mailchimp__automation_emails"], "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.b6ed84cd9c": ["model.mailchimp.mailchimp__automation_emails"], "test.mailchimp.unique_mailchimp__automation_activities_activity_id.e455285fa8": ["model.mailchimp.mailchimp__automation_activities"], "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.e225bd7be1": ["model.mailchimp.mailchimp__automation_activities"], "test.mailchimp.unique_mailchimp__segments_segment_id.b104dc2fe7": ["model.mailchimp.mailchimp__segments"], "test.mailchimp.not_null_mailchimp__segments_segment_id.26bfa1b782": ["model.mailchimp.mailchimp__segments"], "source.mailchimp_source.mailchimp.automation": [], "source.mailchimp_source.mailchimp.automation_email": [], "source.mailchimp_source.mailchimp.automation_recipient": [], "source.mailchimp_source.mailchimp.automation_recipient_activity": [], "source.mailchimp_source.mailchimp.campaign": [], "source.mailchimp_source.mailchimp.campaign_recipient": [], "source.mailchimp_source.mailchimp.campaign_recipient_activity": [], "source.mailchimp_source.mailchimp.segment": [], "source.mailchimp_source.mailchimp.segment_member": [], "source.mailchimp_source.mailchimp.list": [], "source.mailchimp_source.mailchimp.member": [], "source.mailchimp_source.mailchimp.unsubscribe": []}, "child_map": {"model.mailchimp_source.stg_mailchimp__segments": ["model.mailchimp.mailchimp__segments", "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744", "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["model.mailchimp.mailchimp__campaign_recipients", "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199", "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d"], "model.mailchimp_source.stg_mailchimp__lists": ["model.mailchimp.mailchimp__lists", "model.mailchimp.mailchimp__segments", "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121", "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["model.mailchimp.mailchimp__automation_activities", "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475", "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__campaign_recipients", "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab", "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746"], "model.mailchimp_source.stg_mailchimp__campaigns": ["model.mailchimp.mailchimp__campaign_activities", "model.mailchimp.mailchimp__campaign_recipients", "model.mailchimp.mailchimp__campaigns", "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd", "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0"], "model.mailchimp_source.stg_mailchimp__automations": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities", "model.mailchimp.mailchimp__automation_emails", "model.mailchimp.mailchimp__automations", "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a", "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["model.mailchimp.int_mailchimp__automation_recipients", "model.mailchimp.int_mailchimp__automation_unsubscribes", "model.mailchimp.mailchimp__automation_activities", "model.mailchimp.mailchimp__automation_emails", "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594", "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["model.mailchimp.int_mailchimp__automation_recipients", "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912", "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272"], "model.mailchimp_source.stg_mailchimp__members": ["model.mailchimp.mailchimp__members", "test.mailchimp_source.not_null_stg_mailchimp__members_list_member_id.5079cadaf2", "test.mailchimp_source.unique_stg_mailchimp__members_list_member_id.5ff17f888f"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["model.mailchimp.mailchimp__campaign_activities", "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da", "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe"], "model.mailchimp_source.stg_mailchimp__segment_members": ["test.mailchimp_source.not_null_stg_mailchimp__segment_members_segment_member_id.fcd8f8c3d8", "test.mailchimp_source.unique_stg_mailchimp__segment_members_segment_member_id.545e7c979a"], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_activities"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp_source.stg_mailchimp__lists"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp_source.stg_mailchimp__campaign_recipients"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["model.mailchimp_source.stg_mailchimp__segments", "model.mailchimp_source.stg_mailchimp__segments"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["model.mailchimp_source.stg_mailchimp__segment_members", "model.mailchimp_source.stg_mailchimp__segment_members"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["model.mailchimp_source.stg_mailchimp__members", "model.mailchimp_source.stg_mailchimp__members"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automation_emails"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automation_recipients"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaign_activities"], "model.mailchimp.mailchimp__automation_activities": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_segment", "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.e225bd7be1", "test.mailchimp.unique_mailchimp__automation_activities_activity_id.e455285fa8"], "model.mailchimp.mailchimp__lists": ["test.mailchimp.not_null_mailchimp__lists_list_id.310995cf61", "test.mailchimp.unique_mailchimp__lists_list_id.02d919c4b7"], "model.mailchimp.mailchimp__members": ["model.mailchimp.int_mailchimp__members_by_list", "test.mailchimp.not_null_mailchimp__members_list_member_id.aac183787a", "test.mailchimp.unique_mailchimp__members_list_member_id.41741e9b6e"], "model.mailchimp.mailchimp__campaigns": ["test.mailchimp.not_null_mailchimp__campaigns_campaign_id.809cc27175", "test.mailchimp.unique_mailchimp__campaigns_campaign_id.eb6be29df4"], "model.mailchimp.mailchimp__campaign_activities": ["model.mailchimp.int_mailchimp__campaign_activities_by_email", "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.358cb1d1f6", "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.8a67feefd5"], "model.mailchimp.mailchimp__campaign_recipients": ["model.mailchimp.int_mailchimp__campaign_activities_by_campaign", "model.mailchimp.int_mailchimp__campaign_activities_by_list", "model.mailchimp.int_mailchimp__campaign_activities_by_member", "model.mailchimp.int_mailchimp__campaign_activities_by_segment", "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.0ae99b3cf9", "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.9c859c5286"], "model.mailchimp.mailchimp__automations": ["test.mailchimp.not_null_mailchimp__automations_automation_id.99246c168e", "test.mailchimp.unique_mailchimp__automations_automation_id.a3de618dee"], "model.mailchimp.mailchimp__automation_emails": ["test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.b6ed84cd9c", "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.ac05084851"], "model.mailchimp.mailchimp__segments": ["test.mailchimp.not_null_mailchimp__segments_segment_id.26bfa1b782", "test.mailchimp.unique_mailchimp__segments_segment_id.b104dc2fe7"], "model.mailchimp.int_mailchimp__automation_activities_by_member": ["model.mailchimp.mailchimp__members"], "model.mailchimp.int_mailchimp__members_by_list": ["model.mailchimp.mailchimp__lists"], "model.mailchimp.int_mailchimp__automation_activities_by_list": ["model.mailchimp.mailchimp__lists"], "model.mailchimp.int_mailchimp__campaign_activities_by_list": ["model.mailchimp.mailchimp__lists"], "model.mailchimp.int_mailchimp__campaign_activities_by_member": ["model.mailchimp.mailchimp__members"], "model.mailchimp.int_mailchimp__campaign_activities_by_segment": ["model.mailchimp.mailchimp__segments"], "model.mailchimp.int_mailchimp__automation_activities_by_automation": ["model.mailchimp.mailchimp__automations"], "model.mailchimp.int_mailchimp__automation_activities_by_email": ["model.mailchimp.mailchimp__automation_emails"], "model.mailchimp.int_mailchimp__automation_unsubscribes": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_segment"], "model.mailchimp.int_mailchimp__campaign_activities_by_campaign": ["model.mailchimp.mailchimp__campaigns"], "model.mailchimp.int_mailchimp__automation_recipients": ["model.mailchimp.int_mailchimp__automation_activities_by_automation", "model.mailchimp.int_mailchimp__automation_activities_by_email", "model.mailchimp.int_mailchimp__automation_activities_by_list", "model.mailchimp.int_mailchimp__automation_activities_by_member", "model.mailchimp.int_mailchimp__automation_activities_by_segment"], "model.mailchimp.int_mailchimp__automation_activities_by_segment": ["model.mailchimp.mailchimp__segments"], "model.mailchimp.int_mailchimp__campaign_activities_by_email": ["model.mailchimp.mailchimp__campaign_recipients"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475": [], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d": [], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912": [], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272": [], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b": [], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da": [], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0": [], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd": [], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92": [], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121": [], "test.mailchimp_source.unique_stg_mailchimp__members_list_member_id.5ff17f888f": [], "test.mailchimp_source.not_null_stg_mailchimp__members_list_member_id.5079cadaf2": [], "test.mailchimp_source.unique_stg_mailchimp__segment_members_segment_member_id.545e7c979a": [], "test.mailchimp_source.not_null_stg_mailchimp__segment_members_segment_member_id.fcd8f8c3d8": [], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5": [], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744": [], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab": [], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746": [], "test.mailchimp.unique_mailchimp__lists_list_id.02d919c4b7": [], "test.mailchimp.not_null_mailchimp__lists_list_id.310995cf61": [], "test.mailchimp.unique_mailchimp__members_list_member_id.41741e9b6e": [], "test.mailchimp.not_null_mailchimp__members_list_member_id.aac183787a": [], "test.mailchimp.unique_mailchimp__campaigns_campaign_id.eb6be29df4": [], "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.809cc27175": [], "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.9c859c5286": [], "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.0ae99b3cf9": [], "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.8a67feefd5": [], "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.358cb1d1f6": [], "test.mailchimp.unique_mailchimp__automations_automation_id.a3de618dee": [], "test.mailchimp.not_null_mailchimp__automations_automation_id.99246c168e": [], "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.ac05084851": [], "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.b6ed84cd9c": [], "test.mailchimp.unique_mailchimp__automation_activities_activity_id.e455285fa8": [], "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.e225bd7be1": [], "test.mailchimp.unique_mailchimp__segments_segment_id.b104dc2fe7": [], "test.mailchimp.not_null_mailchimp__segments_segment_id.26bfa1b782": [], "source.mailchimp_source.mailchimp.automation": ["model.mailchimp_source.stg_mailchimp__automations_tmp"], "source.mailchimp_source.mailchimp.automation_email": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "source.mailchimp_source.mailchimp.automation_recipient": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "source.mailchimp_source.mailchimp.automation_recipient_activity": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "source.mailchimp_source.mailchimp.campaign": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient_activity": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "source.mailchimp_source.mailchimp.segment": ["model.mailchimp_source.stg_mailchimp__segments_tmp"], "source.mailchimp_source.mailchimp.segment_member": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "source.mailchimp_source.mailchimp.list": ["model.mailchimp_source.stg_mailchimp__lists_tmp"], "source.mailchimp_source.mailchimp.member": ["model.mailchimp_source.stg_mailchimp__members_tmp"], "source.mailchimp_source.mailchimp.unsubscribe": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index 752446ce..fa8bfef3 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v2.json", "dbt_version": "0.20.2", "generated_at": "2021-10-22T16:09:28.526245Z", "invocation_id": "0e869736-6313-46cf-8816-33e49d6a2328", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.735679Z", "completed_at": "2021-10-22T16:09:25.753015Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.753552Z", "completed_at": "2021-10-22T16:09:25.753583Z"}], "thread_id": "Thread-1", "execution_time": 0.02325296401977539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.741027Z", "completed_at": "2021-10-22T16:09:25.753275Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.757395Z", "completed_at": "2021-10-22T16:09:25.757408Z"}], "thread_id": "Thread-4", "execution_time": 0.02248096466064453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.736073Z", "completed_at": "2021-10-22T16:09:25.753407Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.757576Z", "completed_at": "2021-10-22T16:09:25.757585Z"}], "thread_id": "Thread-2", "execution_time": 0.02351212501525879, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.736188Z", "completed_at": "2021-10-22T16:09:25.759113Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.760205Z", "completed_at": "2021-10-22T16:09:25.760213Z"}], "thread_id": "Thread-3", "execution_time": 0.02572488784790039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.760845Z", "completed_at": "2021-10-22T16:09:25.779798Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.780025Z", "completed_at": "2021-10-22T16:09:25.780035Z"}], "thread_id": "Thread-1", "execution_time": 0.020463943481445312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.761359Z", "completed_at": "2021-10-22T16:09:25.780568Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.781139Z", "completed_at": "2021-10-22T16:09:25.781148Z"}], "thread_id": "Thread-2", "execution_time": 0.021533966064453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.775849Z", "completed_at": "2021-10-22T16:09:25.780683Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.781487Z", "completed_at": "2021-10-22T16:09:25.781496Z"}], "thread_id": "Thread-3", "execution_time": 0.007350921630859375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.761244Z", "completed_at": "2021-10-22T16:09:25.781243Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.782332Z", "completed_at": "2021-10-22T16:09:25.782341Z"}], "thread_id": "Thread-4", "execution_time": 0.023168087005615234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.782790Z", "completed_at": "2021-10-22T16:09:25.792639Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.802805Z", "completed_at": "2021-10-22T16:09:25.802819Z"}], "thread_id": "Thread-1", "execution_time": 0.027660131454467773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.791925Z", "completed_at": "2021-10-22T16:09:25.809441Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.810281Z", "completed_at": "2021-10-22T16:09:25.810292Z"}], "thread_id": "Thread-2", "execution_time": 0.020936965942382812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.792526Z", "completed_at": "2021-10-22T16:09:25.810043Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.810804Z", "completed_at": "2021-10-22T16:09:25.810812Z"}], "thread_id": "Thread-3", "execution_time": 0.02072429656982422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.797565Z", "completed_at": "2021-10-22T16:09:25.810914Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:25.811874Z", "completed_at": "2021-10-22T16:09:25.811882Z"}], "thread_id": "Thread-4", "execution_time": 0.02582573890686035, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.811409Z", "completed_at": "2021-10-22T16:09:26.627151Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:26.627777Z", "completed_at": "2021-10-22T16:09:26.627790Z"}], "thread_id": "Thread-1", "execution_time": 0.8180580139160156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.820143Z", "completed_at": "2021-10-22T16:09:26.695452Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:26.696299Z", "completed_at": "2021-10-22T16:09:26.696313Z"}], "thread_id": "Thread-3", "execution_time": 0.885296106338501, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.819187Z", "completed_at": "2021-10-22T16:09:26.708978Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:26.715786Z", "completed_at": "2021-10-22T16:09:26.715800Z"}], "thread_id": "Thread-2", "execution_time": 0.8983068466186523, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:25.831196Z", "completed_at": "2021-10-22T16:09:26.741188Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:26.741341Z", "completed_at": "2021-10-22T16:09:26.741353Z"}], "thread_id": "Thread-4", "execution_time": 0.9212031364440918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:26.708353Z", "completed_at": "2021-10-22T16:09:27.269495Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.269858Z", "completed_at": "2021-10-22T16:09:27.269869Z"}], "thread_id": "Thread-3", "execution_time": 0.5632569789886475, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:26.695633Z", "completed_at": "2021-10-22T16:09:27.280792Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.281115Z", "completed_at": "2021-10-22T16:09:27.281127Z"}], "thread_id": "Thread-1", "execution_time": 0.5872178077697754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:26.719887Z", "completed_at": "2021-10-22T16:09:27.344595Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.344832Z", "completed_at": "2021-10-22T16:09:27.344844Z"}], "thread_id": "Thread-2", "execution_time": 0.6262860298156738, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:26.742582Z", "completed_at": "2021-10-22T16:09:27.365545Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.365688Z", "completed_at": "2021-10-22T16:09:27.365699Z"}], "thread_id": "Thread-4", "execution_time": 0.6237080097198486, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.271905Z", "completed_at": "2021-10-22T16:09:27.859882Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.860042Z", "completed_at": "2021-10-22T16:09:27.860054Z"}], "thread_id": "Thread-3", "execution_time": 0.5889742374420166, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.861113Z", "completed_at": "2021-10-22T16:09:27.869399Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.869557Z", "completed_at": "2021-10-22T16:09:27.869569Z"}], "thread_id": "Thread-3", "execution_time": 0.008981943130493164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.870493Z", "completed_at": "2021-10-22T16:09:27.878933Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.879100Z", "completed_at": "2021-10-22T16:09:27.879114Z"}], "thread_id": "Thread-3", "execution_time": 0.00915980339050293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.879895Z", "completed_at": "2021-10-22T16:09:27.884859Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.885006Z", "completed_at": "2021-10-22T16:09:27.885015Z"}], "thread_id": "Thread-3", "execution_time": 0.005591154098510742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.886518Z", "completed_at": "2021-10-22T16:09:27.896109Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.896393Z", "completed_at": "2021-10-22T16:09:27.896405Z"}], "thread_id": "Thread-3", "execution_time": 0.011270761489868164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.897841Z", "completed_at": "2021-10-22T16:09:27.903347Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.903617Z", "completed_at": "2021-10-22T16:09:27.903630Z"}], "thread_id": "Thread-3", "execution_time": 0.00659489631652832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.905205Z", "completed_at": "2021-10-22T16:09:27.910873Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.911129Z", "completed_at": "2021-10-22T16:09:27.911140Z"}], "thread_id": "Thread-3", "execution_time": 0.006875038146972656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.923958Z", "completed_at": "2021-10-22T16:09:27.931563Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.932073Z", "completed_at": "2021-10-22T16:09:27.932082Z"}], "thread_id": "Thread-3", "execution_time": 0.008919000625610352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__automation_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.282927Z", "completed_at": "2021-10-22T16:09:27.932939Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.933322Z", "completed_at": "2021-10-22T16:09:27.933329Z"}], "thread_id": "Thread-1", "execution_time": 0.651390790939331, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.933452Z", "completed_at": "2021-10-22T16:09:27.943961Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.944303Z", "completed_at": "2021-10-22T16:09:27.944317Z"}], "thread_id": "Thread-3", "execution_time": 0.011626005172729492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.938847Z", "completed_at": "2021-10-22T16:09:27.945769Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.946278Z", "completed_at": "2021-10-22T16:09:27.946287Z"}], "thread_id": "Thread-1", "execution_time": 0.00836801528930664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.957991Z", "completed_at": "2021-10-22T16:09:27.966856Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.967685Z", "completed_at": "2021-10-22T16:09:27.967694Z"}], "thread_id": "Thread-1", "execution_time": 0.016081809997558594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.366766Z", "completed_at": "2021-10-22T16:09:27.973894Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.974583Z", "completed_at": "2021-10-22T16:09:27.974591Z"}], "thread_id": "Thread-4", "execution_time": 0.6089937686920166, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.967559Z", "completed_at": "2021-10-22T16:09:27.974438Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.975097Z", "completed_at": "2021-10-22T16:09:27.975104Z"}], "thread_id": "Thread-3", "execution_time": 0.00939798355102539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.975526Z", "completed_at": "2021-10-22T16:09:27.982567Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.988567Z", "completed_at": "2021-10-22T16:09:27.988583Z"}], "thread_id": "Thread-1", "execution_time": 0.020108938217163086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.982470Z", "completed_at": "2021-10-22T16:09:27.995467Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.996238Z", "completed_at": "2021-10-22T16:09:27.996248Z"}], "thread_id": "Thread-4", "execution_time": 0.01560521125793457, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.982937Z", "completed_at": "2021-10-22T16:09:27.996342Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:27.997334Z", "completed_at": "2021-10-22T16:09:27.997343Z"}], "thread_id": "Thread-3", "execution_time": 0.016607999801635742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.346421Z", "completed_at": "2021-10-22T16:09:28.005060Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.005710Z", "completed_at": "2021-10-22T16:09:28.005720Z"}], "thread_id": "Thread-2", "execution_time": 0.6674549579620361, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:27.997500Z", "completed_at": "2021-10-22T16:09:28.005816Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.013657Z", "completed_at": "2021-10-22T16:09:28.013667Z"}], "thread_id": "Thread-1", "execution_time": 0.022299766540527344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.005278Z", "completed_at": "2021-10-22T16:09:28.018875Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.019903Z", "completed_at": "2021-10-22T16:09:28.019910Z"}], "thread_id": "Thread-4", "execution_time": 0.016243934631347656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__campaign_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.013177Z", "completed_at": "2021-10-22T16:09:28.019780Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.020384Z", "completed_at": "2021-10-22T16:09:28.020391Z"}], "thread_id": "Thread-3", "execution_time": 0.02014899253845215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.020031Z", "completed_at": "2021-10-22T16:09:28.031564Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.032296Z", "completed_at": "2021-10-22T16:09:28.032308Z"}], "thread_id": "Thread-2", "execution_time": 0.018620967864990234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.025320Z", "completed_at": "2021-10-22T16:09:28.032415Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.038057Z", "completed_at": "2021-10-22T16:09:28.038068Z"}], "thread_id": "Thread-1", "execution_time": 0.02366805076599121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.032123Z", "completed_at": "2021-10-22T16:09:28.044021Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.044725Z", "completed_at": "2021-10-22T16:09:28.044734Z"}], "thread_id": "Thread-4", "execution_time": 0.014276266098022461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.032564Z", "completed_at": "2021-10-22T16:09:28.045679Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.050549Z", "completed_at": "2021-10-22T16:09:28.050559Z"}], "thread_id": "Thread-3", "execution_time": 0.025566816329956055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.69f7ec2ea4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.044879Z", "completed_at": "2021-10-22T16:09:28.057532Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.058178Z", "completed_at": "2021-10-22T16:09:28.058186Z"}], "thread_id": "Thread-2", "execution_time": 0.019058942794799805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__automation_activities_activity_id.028a855f2c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.050234Z", "completed_at": "2021-10-22T16:09:28.058270Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.063416Z", "completed_at": "2021-10-22T16:09:28.063425Z"}], "thread_id": "Thread-1", "execution_time": 0.019091129302978516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.057772Z", "completed_at": "2021-10-22T16:09:28.064335Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.094270Z", "completed_at": "2021-10-22T16:09:28.094281Z"}], "thread_id": "Thread-4", "execution_time": 0.03821110725402832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.197732Z", "completed_at": "2021-10-22T16:09:28.211026Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.211756Z", "completed_at": "2021-10-22T16:09:28.211768Z"}], "thread_id": "Thread-2", "execution_time": 0.018944978713989258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.204493Z", "completed_at": "2021-10-22T16:09:28.215130Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.215863Z", "completed_at": "2021-10-22T16:09:28.215873Z"}], "thread_id": "Thread-1", "execution_time": 0.023128032684326172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.215266Z", "completed_at": "2021-10-22T16:09:28.222613Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.223525Z", "completed_at": "2021-10-22T16:09:28.223533Z"}], "thread_id": "Thread-3", "execution_time": 0.017829179763793945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.f493ad0b31"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.222830Z", "completed_at": "2021-10-22T16:09:28.246140Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.259179Z", "completed_at": "2021-10-22T16:09:28.259195Z"}], "thread_id": "Thread-2", "execution_time": 0.04982399940490723, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.28bf1e5fbd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.228971Z", "completed_at": "2021-10-22T16:09:28.272162Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.301878Z", "completed_at": "2021-10-22T16:09:28.301891Z"}], "thread_id": "Thread-1", "execution_time": 0.07925701141357422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__automations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.229522Z", "completed_at": "2021-10-22T16:09:28.295090Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.302078Z", "completed_at": "2021-10-22T16:09:28.302087Z"}], "thread_id": "Thread-4", "execution_time": 0.07412409782409668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__automation_emails"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.272055Z", "completed_at": "2021-10-22T16:09:28.303094Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.303701Z", "completed_at": "2021-10-22T16:09:28.303730Z"}], "thread_id": "Thread-3", "execution_time": 0.03384518623352051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__campaign_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.305320Z", "completed_at": "2021-10-22T16:09:28.321750Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.327063Z", "completed_at": "2021-10-22T16:09:28.327075Z"}], "thread_id": "Thread-2", "execution_time": 0.02360701560974121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__automations_automation_id.c6a95d5564"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.305433Z", "completed_at": "2021-10-22T16:09:28.326902Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.327412Z", "completed_at": "2021-10-22T16:09:28.327420Z"}], "thread_id": "Thread-4", "execution_time": 0.023867130279541016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__automations_automation_id.027f8f6fb3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.305954Z", "completed_at": "2021-10-22T16:09:28.327249Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.327963Z", "completed_at": "2021-10-22T16:09:28.327971Z"}], "thread_id": "Thread-1", "execution_time": 0.024000167846679688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.044b815e20"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.321465Z", "completed_at": "2021-10-22T16:09:28.328123Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.329226Z", "completed_at": "2021-10-22T16:09:28.329233Z"}], "thread_id": "Thread-3", "execution_time": 0.01515817642211914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.218a63b754"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.348089Z", "completed_at": "2021-10-22T16:09:28.364149Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.404679Z", "completed_at": "2021-10-22T16:09:28.404700Z"}], "thread_id": "Thread-2", "execution_time": 0.05851006507873535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.3af4b3f655"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.353923Z", "completed_at": "2021-10-22T16:09:28.405774Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.406499Z", "completed_at": "2021-10-22T16:09:28.406509Z"}], "thread_id": "Thread-4", "execution_time": 0.058920860290527344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.638c4769d4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.354059Z", "completed_at": "2021-10-22T16:09:28.406167Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.407058Z", "completed_at": "2021-10-22T16:09:28.407065Z"}], "thread_id": "Thread-1", "execution_time": 0.05923199653625488, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.354260Z", "completed_at": "2021-10-22T16:09:28.406608Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.407483Z", "completed_at": "2021-10-22T16:09:28.407492Z"}], "thread_id": "Thread-3", "execution_time": 0.054678916931152344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__campaigns"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.407637Z", "completed_at": "2021-10-22T16:09:28.438341Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.441575Z", "completed_at": "2021-10-22T16:09:28.441586Z"}], "thread_id": "Thread-2", "execution_time": 0.04669690132141113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__segments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.438499Z", "completed_at": "2021-10-22T16:09:28.454711Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.455583Z", "completed_at": "2021-10-22T16:09:28.455592Z"}], "thread_id": "Thread-4", "execution_time": 0.01877284049987793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__members_member_id.b3d42f42f5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.441435Z", "completed_at": "2021-10-22T16:09:28.455168Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.455862Z", "completed_at": "2021-10-22T16:09:28.455870Z"}], "thread_id": "Thread-1", "execution_time": 0.02361583709716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__members_member_id.cf802ea62a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.455729Z", "completed_at": "2021-10-22T16:09:28.467574Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.468277Z", "completed_at": "2021-10-22T16:09:28.468288Z"}], "thread_id": "Thread-2", "execution_time": 0.01847672462463379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.b2a5bb0c67"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.461901Z", "completed_at": "2021-10-22T16:09:28.468523Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.477823Z", "completed_at": "2021-10-22T16:09:28.477834Z"}], "thread_id": "Thread-3", "execution_time": 0.02275705337524414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__campaigns_campaign_id.17cc6ca14f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.468108Z", "completed_at": "2021-10-22T16:09:28.478480Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.479272Z", "completed_at": "2021-10-22T16:09:28.479279Z"}], "thread_id": "Thread-4", "execution_time": 0.012570858001708984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__segments_segment_id.1b04ffa743"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.468432Z", "completed_at": "2021-10-22T16:09:28.479385Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.480045Z", "completed_at": "2021-10-22T16:09:28.480052Z"}], "thread_id": "Thread-1", "execution_time": 0.04105114936828613, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__segments_segment_id.6fa54c3e6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.479650Z", "completed_at": "2021-10-22T16:09:28.509857Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.510036Z", "completed_at": "2021-10-22T16:09:28.510046Z"}], "thread_id": "Thread-2", "execution_time": 0.03145122528076172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__lists"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.511904Z", "completed_at": "2021-10-22T16:09:28.523772Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.523933Z", "completed_at": "2021-10-22T16:09:28.523944Z"}], "thread_id": "Thread-3", "execution_time": 0.012994050979614258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__lists_list_id.3b19bed371"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:09:28.512026Z", "completed_at": "2021-10-22T16:09:28.524035Z"}, {"name": "execute", "started_at": "2021-10-22T16:09:28.524487Z", "completed_at": "2021-10-22T16:09:28.524495Z"}], "thread_id": "Thread-4", "execution_time": 0.013274192810058594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__lists_list_id.ac74445e11"}], "elapsed_time": 3.955369234085083, "args": {"log_format": "default", "write_json": true, "use_experimental_parser": false, "profiles_dir": "/Users/renee.li/.dbt", "use_cache": true, "compile": true, "version_check": true, "which": "generate", "rpc_method": "docs.generate"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-01-12T20:14:13.355835Z", "invocation_id": "b34aa7dc-6b6b-4c9b-93da-d6b0325c8f1a", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.217125Z", "completed_at": "2022-01-12T20:14:11.241130Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.242431Z", "completed_at": "2022-01-12T20:14:11.242461Z"}], "thread_id": "Thread-1", "execution_time": 0.029031991958618164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.217583Z", "completed_at": "2022-01-12T20:14:11.241485Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.243010Z", "completed_at": "2022-01-12T20:14:11.243018Z"}], "thread_id": "Thread-2", "execution_time": 0.028854846954345703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.224910Z", "completed_at": "2022-01-12T20:14:11.242028Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.243825Z", "completed_at": "2022-01-12T20:14:11.243833Z"}], "thread_id": "Thread-3", "execution_time": 0.02919602394104004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.230628Z", "completed_at": "2022-01-12T20:14:11.242662Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.244666Z", "completed_at": "2022-01-12T20:14:11.244676Z"}], "thread_id": "Thread-4", "execution_time": 0.029906749725341797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.248898Z", "completed_at": "2022-01-12T20:14:11.272563Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.273971Z", "completed_at": "2022-01-12T20:14:11.273984Z"}], "thread_id": "Thread-1", "execution_time": 0.028832197189331055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.249689Z", "completed_at": "2022-01-12T20:14:11.273007Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.274503Z", "completed_at": "2022-01-12T20:14:11.274512Z"}], "thread_id": "Thread-2", "execution_time": 0.02834010124206543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.255177Z", "completed_at": "2022-01-12T20:14:11.273544Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.275275Z", "completed_at": "2022-01-12T20:14:11.275283Z"}], "thread_id": "Thread-3", "execution_time": 0.028731107711791992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.263885Z", "completed_at": "2022-01-12T20:14:11.274128Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.276277Z", "completed_at": "2022-01-12T20:14:11.276286Z"}], "thread_id": "Thread-4", "execution_time": 0.02899932861328125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.280356Z", "completed_at": "2022-01-12T20:14:11.300559Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.301863Z", "completed_at": "2022-01-12T20:14:11.301944Z"}], "thread_id": "Thread-1", "execution_time": 0.02564406394958496, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.281138Z", "completed_at": "2022-01-12T20:14:11.300848Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.302568Z", "completed_at": "2022-01-12T20:14:11.302580Z"}], "thread_id": "Thread-2", "execution_time": 0.025216102600097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.285910Z", "completed_at": "2022-01-12T20:14:11.301407Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.303460Z", "completed_at": "2022-01-12T20:14:11.303470Z"}], "thread_id": "Thread-3", "execution_time": 0.025218963623046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.290966Z", "completed_at": "2022-01-12T20:14:11.302153Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.304534Z", "completed_at": "2022-01-12T20:14:11.304543Z"}], "thread_id": "Thread-4", "execution_time": 0.025456905364990234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.308054Z", "completed_at": "2022-01-12T20:14:11.744731Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.763446Z", "completed_at": "2022-01-12T20:14:11.763465Z"}], "thread_id": "Thread-1", "execution_time": 0.46251583099365234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.316934Z", "completed_at": "2022-01-12T20:14:11.819876Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.820688Z", "completed_at": "2022-01-12T20:14:11.820703Z"}], "thread_id": "Thread-3", "execution_time": 0.5199248790740967, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.324438Z", "completed_at": "2022-01-12T20:14:11.849604Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.850027Z", "completed_at": "2022-01-12T20:14:11.850040Z"}], "thread_id": "Thread-4", "execution_time": 0.5421609878540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.308745Z", "completed_at": "2022-01-12T20:14:11.876490Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:11.876859Z", "completed_at": "2022-01-12T20:14:11.876871Z"}], "thread_id": "Thread-2", "execution_time": 0.5706508159637451, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.770067Z", "completed_at": "2022-01-12T20:14:12.186399Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.186877Z", "completed_at": "2022-01-12T20:14:12.186890Z"}], "thread_id": "Thread-1", "execution_time": 0.41809988021850586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.830375Z", "completed_at": "2022-01-12T20:14:12.195885Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.196273Z", "completed_at": "2022-01-12T20:14:12.196284Z"}], "thread_id": "Thread-3", "execution_time": 0.3672347068786621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.878490Z", "completed_at": "2022-01-12T20:14:12.270178Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.270756Z", "completed_at": "2022-01-12T20:14:12.270765Z"}], "thread_id": "Thread-2", "execution_time": 0.3936460018157959, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:11.852187Z", "completed_at": "2022-01-12T20:14:12.278380Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.278961Z", "completed_at": "2022-01-12T20:14:12.278970Z"}], "thread_id": "Thread-4", "execution_time": 0.4283902645111084, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.198212Z", "completed_at": "2022-01-12T20:14:12.621255Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.621760Z", "completed_at": "2022-01-12T20:14:12.621771Z"}], "thread_id": "Thread-3", "execution_time": 0.4243330955505371, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.623374Z", "completed_at": "2022-01-12T20:14:12.634979Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.635289Z", "completed_at": "2022-01-12T20:14:12.635298Z"}], "thread_id": "Thread-3", "execution_time": 0.013134002685546875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.636343Z", "completed_at": "2022-01-12T20:14:12.644060Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.644361Z", "completed_at": "2022-01-12T20:14:12.644369Z"}], "thread_id": "Thread-3", "execution_time": 0.008690118789672852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.645597Z", "completed_at": "2022-01-12T20:14:12.650626Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.650958Z", "completed_at": "2022-01-12T20:14:12.650966Z"}], "thread_id": "Thread-3", "execution_time": 0.006087064743041992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.652002Z", "completed_at": "2022-01-12T20:14:12.657623Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.658737Z", "completed_at": "2022-01-12T20:14:12.658747Z"}], "thread_id": "Thread-3", "execution_time": 0.00815892219543457, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.273002Z", "completed_at": "2022-01-12T20:14:12.658443Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.660199Z", "completed_at": "2022-01-12T20:14:12.660207Z"}], "thread_id": "Thread-2", "execution_time": 0.3892030715942383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.664624Z", "completed_at": "2022-01-12T20:14:12.679246Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.679718Z", "completed_at": "2022-01-12T20:14:12.679726Z"}], "thread_id": "Thread-3", "execution_time": 0.017555952072143555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.190225Z", "completed_at": "2022-01-12T20:14:12.685515Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.686067Z", "completed_at": "2022-01-12T20:14:12.686075Z"}], "thread_id": "Thread-1", "execution_time": 0.49860501289367676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.669635Z", "completed_at": "2022-01-12T20:14:12.692630Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.692915Z", "completed_at": "2022-01-12T20:14:12.692922Z"}], "thread_id": "Thread-2", "execution_time": 0.029094934463500977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.686954Z", "completed_at": "2022-01-12T20:14:12.697996Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.698308Z", "completed_at": "2022-01-12T20:14:12.698314Z"}], "thread_id": "Thread-1", "execution_time": 0.011924982070922852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__automation_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.694488Z", "completed_at": "2022-01-12T20:14:12.699283Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.708133Z", "completed_at": "2022-01-12T20:14:12.708140Z"}], "thread_id": "Thread-2", "execution_time": 0.014966011047363281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.280797Z", "completed_at": "2022-01-12T20:14:12.708761Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.713186Z", "completed_at": "2022-01-12T20:14:12.713195Z"}], "thread_id": "Thread-4", "execution_time": 0.43360209465026855, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.708631Z", "completed_at": "2022-01-12T20:14:12.713715Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.718233Z", "completed_at": "2022-01-12T20:14:12.718241Z"}], "thread_id": "Thread-1", "execution_time": 0.016948938369750977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.713615Z", "completed_at": "2022-01-12T20:14:12.721598Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.722848Z", "completed_at": "2022-01-12T20:14:12.722855Z"}], "thread_id": "Thread-3", "execution_time": 0.017525911331176758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.717998Z", "completed_at": "2022-01-12T20:14:12.722730Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.727055Z", "completed_at": "2022-01-12T20:14:12.727062Z"}], "thread_id": "Thread-2", "execution_time": 0.014476776123046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.722540Z", "completed_at": "2022-01-12T20:14:12.727622Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.735398Z", "completed_at": "2022-01-12T20:14:12.735418Z"}], "thread_id": "Thread-4", "execution_time": 0.018883705139160156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.727484Z", "completed_at": "2022-01-12T20:14:12.738045Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.751294Z", "completed_at": "2022-01-12T20:14:12.751311Z"}], "thread_id": "Thread-1", "execution_time": 0.029350996017456055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.736387Z", "completed_at": "2022-01-12T20:14:12.751720Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.762704Z", "completed_at": "2022-01-12T20:14:12.762717Z"}], "thread_id": "Thread-3", "execution_time": 0.035778045654296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.745856Z", "completed_at": "2022-01-12T20:14:12.753068Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.764116Z", "completed_at": "2022-01-12T20:14:12.764126Z"}], "thread_id": "Thread-2", "execution_time": 0.02923274040222168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.752670Z", "completed_at": "2022-01-12T20:14:12.764294Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.766215Z", "completed_at": "2022-01-12T20:14:12.766225Z"}], "thread_id": "Thread-4", "execution_time": 0.024286985397338867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__campaign_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.765462Z", "completed_at": "2022-01-12T20:14:12.771691Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.780668Z", "completed_at": "2022-01-12T20:14:12.780681Z"}], "thread_id": "Thread-1", "execution_time": 0.018384218215942383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.771065Z", "completed_at": "2022-01-12T20:14:12.780819Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.787170Z", "completed_at": "2022-01-12T20:14:12.787179Z"}], "thread_id": "Thread-3", "execution_time": 0.02273416519165039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.775816Z", "completed_at": "2022-01-12T20:14:12.781712Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.787896Z", "completed_at": "2022-01-12T20:14:12.787907Z"}], "thread_id": "Thread-2", "execution_time": 0.018532991409301758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segment_members_segment_member_id.fcd8f8c3d8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.781114Z", "completed_at": "2022-01-12T20:14:12.788081Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.789969Z", "completed_at": "2022-01-12T20:14:12.789979Z"}], "thread_id": "Thread-4", "execution_time": 0.01860523223876953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segment_members_segment_member_id.545e7c979a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.789403Z", "completed_at": "2022-01-12T20:14:12.795574Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.804062Z", "completed_at": "2022-01-12T20:14:12.804073Z"}], "thread_id": "Thread-1", "execution_time": 0.017397165298461914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.795793Z", "completed_at": "2022-01-12T20:14:12.805014Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.809988Z", "completed_at": "2022-01-12T20:14:12.809999Z"}], "thread_id": "Thread-3", "execution_time": 0.02064681053161621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.795968Z", "completed_at": "2022-01-12T20:14:12.805197Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.810321Z", "completed_at": "2022-01-12T20:14:12.810330Z"}], "thread_id": "Thread-2", "execution_time": 0.017187118530273438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_list_member_id.5079cadaf2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.804475Z", "completed_at": "2022-01-12T20:14:12.810175Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.811838Z", "completed_at": "2022-01-12T20:14:12.811846Z"}], "thread_id": "Thread-4", "execution_time": 0.020107030868530273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_list_member_id.5ff17f888f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.811472Z", "completed_at": "2022-01-12T20:14:12.817504Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.828738Z", "completed_at": "2022-01-12T20:14:12.828749Z"}], "thread_id": "Thread-1", "execution_time": 0.020078182220458984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__automation_activities_activity_id.e225bd7be1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.817673Z", "completed_at": "2022-01-12T20:14:12.829391Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.834425Z", "completed_at": "2022-01-12T20:14:12.834435Z"}], "thread_id": "Thread-3", "execution_time": 0.01967787742614746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__automation_activities_activity_id.e455285fa8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.829046Z", "completed_at": "2022-01-12T20:14:12.834584Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.836668Z", "completed_at": "2022-01-12T20:14:12.836675Z"}], "thread_id": "Thread-4", "execution_time": 0.019675731658935547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.836827Z", "completed_at": "2022-01-12T20:14:12.845391Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.849747Z", "completed_at": "2022-01-12T20:14:12.849755Z"}], "thread_id": "Thread-1", "execution_time": 0.029881954193115234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.844641Z", "completed_at": "2022-01-12T20:14:12.849596Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.865319Z", "completed_at": "2022-01-12T20:14:12.865331Z"}], "thread_id": "Thread-3", "execution_time": 0.029111146926879883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__campaign_activities_activity_id.358cb1d1f6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.849116Z", "completed_at": "2022-01-12T20:14:12.865781Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:12.867523Z", "completed_at": "2022-01-12T20:14:12.867533Z"}], "thread_id": "Thread-4", "execution_time": 0.053646087646484375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__campaign_activities_activity_id.8a67feefd5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:12.973123Z", "completed_at": "2022-01-12T20:14:13.035947Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.047816Z", "completed_at": "2022-01-12T20:14:13.047828Z"}], "thread_id": "Thread-1", "execution_time": 0.0977928638458252, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__campaign_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.029782Z", "completed_at": "2022-01-12T20:14:13.053469Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.073677Z", "completed_at": "2022-01-12T20:14:13.073693Z"}], "thread_id": "Thread-3", "execution_time": 0.08588123321533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__automations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.047512Z", "completed_at": "2022-01-12T20:14:13.074561Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.076761Z", "completed_at": "2022-01-12T20:14:13.076772Z"}], "thread_id": "Thread-4", "execution_time": 0.05127716064453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__automation_emails"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.102808Z", "completed_at": "2022-01-12T20:14:13.121392Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.123365Z", "completed_at": "2022-01-12T20:14:13.123380Z"}], "thread_id": "Thread-2", "execution_time": 0.028059959411621094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__campaign_recipients_email_id.0ae99b3cf9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.103576Z", "completed_at": "2022-01-12T20:14:13.122321Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.123957Z", "completed_at": "2022-01-12T20:14:13.123968Z"}], "thread_id": "Thread-1", "execution_time": 0.02951192855834961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__campaign_recipients_email_id.9c859c5286"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.115530Z", "completed_at": "2022-01-12T20:14:13.122973Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.130356Z", "completed_at": "2022-01-12T20:14:13.130374Z"}], "thread_id": "Thread-3", "execution_time": 0.028911113739013672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__automations_automation_id.99246c168e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.123584Z", "completed_at": "2022-01-12T20:14:13.132863Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.135684Z", "completed_at": "2022-01-12T20:14:13.135700Z"}], "thread_id": "Thread-4", "execution_time": 0.01519632339477539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__automations_automation_id.a3de618dee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.135943Z", "completed_at": "2022-01-12T20:14:13.162059Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.200798Z", "completed_at": "2022-01-12T20:14:13.200822Z"}], "thread_id": "Thread-2", "execution_time": 0.06884884834289551, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__automation_emails_automation_email_id.b6ed84cd9c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.136558Z", "completed_at": "2022-01-12T20:14:13.193309Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.202255Z", "completed_at": "2022-01-12T20:14:13.202268Z"}], "thread_id": "Thread-1", "execution_time": 0.06962418556213379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__automation_emails_automation_email_id.ac05084851"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.142907Z", "completed_at": "2022-01-12T20:14:13.201491Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.203751Z", "completed_at": "2022-01-12T20:14:13.203762Z"}], "thread_id": "Thread-3", "execution_time": 0.07005524635314941, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__campaigns"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.161816Z", "completed_at": "2022-01-12T20:14:13.202760Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.205360Z", "completed_at": "2022-01-12T20:14:13.205371Z"}], "thread_id": "Thread-4", "execution_time": 0.04511690139770508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.206357Z", "completed_at": "2022-01-12T20:14:13.244361Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.266282Z", "completed_at": "2022-01-12T20:14:13.266301Z"}], "thread_id": "Thread-2", "execution_time": 0.06292414665222168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__segments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.244010Z", "completed_at": "2022-01-12T20:14:13.267533Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.269422Z", "completed_at": "2022-01-12T20:14:13.269435Z"}], "thread_id": "Thread-1", "execution_time": 0.04099297523498535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__campaigns_campaign_id.809cc27175"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.244637Z", "completed_at": "2022-01-12T20:14:13.268404Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.271340Z", "completed_at": "2022-01-12T20:14:13.271353Z"}], "thread_id": "Thread-4", "execution_time": 0.03120899200439453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__campaigns_campaign_id.eb6be29df4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.271584Z", "completed_at": "2022-01-12T20:14:13.280316Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.292148Z", "completed_at": "2022-01-12T20:14:13.292163Z"}], "thread_id": "Thread-2", "execution_time": 0.02871417999267578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__members_list_member_id.aac183787a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.279962Z", "completed_at": "2022-01-12T20:14:13.297802Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.299683Z", "completed_at": "2022-01-12T20:14:13.299696Z"}], "thread_id": "Thread-3", "execution_time": 0.02323007583618164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__members_list_member_id.41741e9b6e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.280528Z", "completed_at": "2022-01-12T20:14:13.298976Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.300956Z", "completed_at": "2022-01-12T20:14:13.300968Z"}], "thread_id": "Thread-1", "execution_time": 0.024068117141723633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__segments_segment_id.26bfa1b782"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.291830Z", "completed_at": "2022-01-12T20:14:13.299127Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.301170Z", "completed_at": "2022-01-12T20:14:13.301179Z"}], "thread_id": "Thread-4", "execution_time": 0.02300286293029785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__segments_segment_id.b104dc2fe7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.301389Z", "completed_at": "2022-01-12T20:14:13.337667Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.338106Z", "completed_at": "2022-01-12T20:14:13.338120Z"}], "thread_id": "Thread-2", "execution_time": 0.03920888900756836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp.mailchimp__lists"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.340791Z", "completed_at": "2022-01-12T20:14:13.352001Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.352853Z", "completed_at": "2022-01-12T20:14:13.352867Z"}], "thread_id": "Thread-3", "execution_time": 0.013753175735473633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.not_null_mailchimp__lists_list_id.310995cf61"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-01-12T20:14:13.340979Z", "completed_at": "2022-01-12T20:14:13.352225Z"}, {"name": "execute", "started_at": "2022-01-12T20:14:13.353062Z", "completed_at": "2022-01-12T20:14:13.353072Z"}], "thread_id": "Thread-1", "execution_time": 0.013772010803222656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp.unique_mailchimp__lists_list_id.02d919c4b7"}], "elapsed_time": 3.349381923675537, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/renee.li/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "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 18293959..962a2b2a 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'mailchimp_integration_tests' -version: '0.5.0' +version: '0.7.0' profile: 'integration_tests' diff --git a/integration_tests/seeds/list.csv b/integration_tests/seeds/list.csv index 9c594993..d813bd17 100644 --- a/integration_tests/seeds/list.csv +++ b/integration_tests/seeds/list.csv @@ -1,2 +1,3 @@ id,_fivetran_deleted,_fivetran_synced,beamer_address,contact_address_1,contact_address_2,contact_city,contact_company,contact_country,contact_state,contact_zip,date_created,default_from_email,default_from_name,default_language,default_subject,email_type_option,list_rating,name,notify_on_subscribe,notify_on_unsubscribe,permission_reminder,subscribe_url_long,subscribe_url_short,use_archive_bar,visibility 8e423a4179,false,2020-04-23 11:40:05.594,us20-09b84dc149-f4c9468513@inbound.mailchimp.com,87 Hogwarts Avenue,,London,Example Company,UK,London,M5S1K1,2019-10-01 21:39:58,bob@example.com,Bob,en,,false,0.0,Example Company,,,You are receiving this email because you opted in via our website.,https://dev.us20.list-manage.com/subscribe?u=ca09e4761ebff536235e260&id=8e423a4179,http://eepurl.com/gITsH5,true,pub +57423a4179,false,2020-04-23 11:40:05.594,us20-09b84dc149-f4c9468513@inbound.mailchimp.com,87 Hogwarts Avenue,,London,Example Company,UK,London,M5S1K1,2019-10-01 21:39:58,bob@example.com,Bob,en,,false,0.0,Example Company,,,You are receiving this email because you opted in via our website.,https://dev.us20.list-manage.com/subscribe?u=ca09e4761ebff536235e260&id=8e423a4179,http://eepurl.com/gITsH5,true,pub diff --git a/integration_tests/seeds/member.csv b/integration_tests/seeds/member.csv index 0ac0cd1a..d1d15379 100644 --- a/integration_tests/seeds/member.csv +++ b/integration_tests/seeds/member.csv @@ -7,3 +7,5 @@ id,list_id,_fivetran_synced,country_code,dstoff,email_address,email_client,email b2ac489697c655e85db6dfedc5c2fee5,8e423a4179,2020-04-14 21:27:39.423,US,0.0,mary@example.com,Gmail,html,0.0,104.244.24.68,104.244.24.68,en,2019-11-26 23:58:17,37.7482,-122.416,3,Mary,,subscribed,2019-11-06 21:35:22,2019-11-06 21:34:58,415/628,b6a9ddfb47,false f5114e6e6bb39e07781d2f51f409a7fe,8e423a4179,2020-04-14 21:27:39.638,US,0.0,ralph@example.com,Gmail,html,0.0,107.77.211.18,107.77.211.18,en,2019-11-27 00:00:37,37.6343,-122.063,4,Ralph,,subscribed,2019-11-07 18:39:11,2019-11-07 18:38:51,510,3118fb623a,false 37cc8cad6a75f018d69632984d8caf38,8e423a4179,2020-04-14 21:27:39.639,US,0.0,ben@example.com,Apple Mail,html,0.0,198.178.12.68,67.245.32.119,en,2019-11-08 13:10:10,40.7553,-73.992,4,Ben,,subscribed,2019-11-08 13:10:10,2019-11-08 11:27:04,212/332/646/917,6f9d527f62,false +57cc8cad6a75f018d69632984d8caf38,57423a4179,2020-04-14 21:27:39.639,US,0.0,tee@example.com,Apple Mail,html,0.0,198.178.12.68,67.245.32.119,en,2019-11-08 13:10:10,40.7553,-73.992,4,Tee,,subscribed,2019-11-08 13:10:10,2019-11-08 11:27:04,212/332/646/917,6f9d527f62,false +37cc8cad6a75f018d69632984d8caf38,57423a4179,2020-04-14 21:27:39.639,US,0.0,ben@example.com,Apple Mail,html,0.0,198.178.12.68,67.245.32.119,en,2019-11-08 13:10:10,40.7553,-73.992,4,Ben,,subscribed,2019-11-08 13:10:10,2019-11-08 11:27:04,212/332/646/917,6f9d527f62,false diff --git a/models/mailchimp.yml b/models/mailchimp.yml index d580c71d..483ac885 100644 --- a/models/mailchimp.yml +++ b/models/mailchimp.yml @@ -128,12 +128,15 @@ models: - name: mailchimp__members description: Each record represents a member in Mailchimp, enriched with campaign metrics and (optionally) automation metrics. columns: - - name: member_id - description: The ID of the member. + - name: list_member_id + description: The ID of each record, from combining member id and list id. tests: - unique - not_null + - name: member_id + description: The ID of the member. + - name: email_address description: Email address for a subscriber. diff --git a/packages.yml b/packages.yml index 593b2295..18d7ed08 100644 --- a/packages.yml +++ b/packages.yml @@ -1,5 +1,8 @@ packages: -- package: fivetran/mailchimp_source - version: [">=0.3.0", "<0.4.0"] +# - package: fivetran/mailchimp_source +# version: [">=0.3.0", "<0.4.0"] + - git: https://github.com/fivetran/dbt_mailchimp_source.git + revision: bug/unique_tests + warn-unpinned: false