From e2df201e65fbd1531c9d1642e20a2a965785ef7c Mon Sep 17 00:00:00 2001 From: Jonathan Crawford Date: Thu, 4 Apr 2024 11:39:15 -0500 Subject: [PATCH] Migrate test YAML syntax to new data_test namespace to makeway for unit_tests --- .pre-commit-config.yaml | 4 +- .../customer_io/staging/_stg_email_clicks.yml | 23 +- .../staging/_stg_email_conversions.yml | 21 +- .../customer_io/staging/_stg_email_opens.yml | 23 +- models/generic/_currency_conversion_rates.yml | 6 +- .../generic/intermediate/_int_shop_infos.yml | 14 +- .../staging/_stg_constellation_users.yml | 13 +- .../_int_app_store_attribution_schema.yml | 4 +- .../_int_ga_first_visits_schema.yml | 4 +- .../int_ga_app_store_page_events.yml | 2 +- ...nonymous_to_known_user_matching_schema.yml | 4 +- .../intermediate/_int_first_workflow_keys.yml | 2 +- .../intermediate/_int_mesa_flow_events.yml | 5 +- .../mesa/intermediate/_int_mesa_shop_days.yml | 24 +- .../intermediate/_int_mesa_shop_plan_days.yml | 2 +- .../mesa/intermediate/_int_shop_calendar.yml | 16 +- .../_int_shop_install_sources.yml | 8 +- .../mesa/intermediate/_int_shop_lifespans.yml | 12 +- models/mesa/intermediate/_int_shops.yml | 12 +- models/mesa/intermediate/_int_step_runs.yml | 30 +- .../_int_successful_step_run_day_counts.yml | 24 +- models/mesa/intermediate/_int_test_runs.yml | 22 +- .../mesa/intermediate/_int_test_step_runs.yml | 4 +- .../mesa/intermediate/_int_workflow_runs.yml | 40 +- models/mesa/marts/_mesa_charges.yml | 8 +- models/mesa/marts/_shops.yml | 400 ++++++++++++------ models/mesa/marts/_step_runs.yml | 28 +- models/mesa/marts/_workflow_runs.yml | 34 +- models/mesa/marts/_workflow_steps.yml | 35 +- models/mesa/marts/_workflows.yml | 78 ++-- .../marts/rollups/_mesa_growth_accounting.yml | 12 +- .../_mesa_monthly_revenue_accounting.yml | 16 +- .../_mesa_quarterly_revenue_accounting.yml | 40 +- models/mesa/marts/rollups/_mesa_shop_days.yml | 120 ++++-- .../_mesa_shop_monthly_cohort_performance.yml | 35 +- .../_mesa_shop_weekly_cohort_performance.yml | 34 +- .../_mesa_weekly_revenue_accounting.yml | 16 +- .../rollups/_monthly_cohort_performance.yml | 20 +- .../_monthly_subscriber_retentions.yml | 4 +- .../rollups/_weekly_subscriber_retention.yml | 4 +- models/mesa/shop_attribution.yml | 10 +- models/mesa/sources.yml | 14 +- models/mesa/staging/_calendar_dates.yml | 2 +- models/mesa/staging/_stg_legacy_daus.yml | 4 +- .../staging/_stg_mesa_billing_accounts.yml | 16 +- models/mesa/staging/_stg_mesa_charges.yml | 6 +- models/mesa/staging/_stg_mesa_flow_events.yml | 5 +- .../_stg_mesa_install_records_schema.yml | 4 +- .../mesa/staging/_stg_shop_entitlements.yml | 4 +- models/mesa/staging/_stg_shop_infos.yml | 3 +- models/mesa/staging/_stg_shops.yml | 12 +- models/mesa/staging/_stg_step_runs.yml | 33 +- models/mesa/staging/_stg_workflow_runs.yml | 22 +- models/mesa/staging/_stg_workflows.yml | 7 +- .../staging/_stg_shopify_plan_changes.yml | 4 +- 55 files changed, 791 insertions(+), 558 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0415dd3..48de130 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/dbt-checkpoint/dbt-checkpoint - rev: v1.1.1 + rev: v1.2.1 hooks: - id: dbt-docs-generate - id: check-script-semicolon @@ -11,7 +11,7 @@ repos: - id: generate-model-properties-file args: ["--properties-file", "./models/mesa/{name}.yml", "--"] - - id: unify-column-description + #- id: unify-column-description - id: check-column-name-contract args: [--pattern, "(is|has|do)_.*", --dtype, boolean] - id: check-model-has-all-columns diff --git a/models/customer_io/staging/_stg_email_clicks.yml b/models/customer_io/staging/_stg_email_clicks.yml index dbe92bc..f9252c0 100644 --- a/models/customer_io/staging/_stg_email_clicks.yml +++ b/models/customer_io/staging/_stg_email_clicks.yml @@ -1,15 +1,16 @@ version: 2 - models: - name: stg_email_clicks - description: "Email clicks from Customer.io" - tags: ["staging", "customer_io"] + description: Email clicks from Customer.io + tags: + - staging + - customer_io columns: - - name: delivery_id - description: "Unique ID for the email delivery" - tests: - - not_null - - name: shop_subdomain - description: "Shopify subdomain" - tests: - - not_null + - name: delivery_id + description: Unique ID for the email delivery + data_tests: + - not_null + - name: shop_subdomain + description: The foreign key for the Shop. + data_tests: + - not_null diff --git a/models/customer_io/staging/_stg_email_conversions.yml b/models/customer_io/staging/_stg_email_conversions.yml index ddcb9dd..ba80ae7 100644 --- a/models/customer_io/staging/_stg_email_conversions.yml +++ b/models/customer_io/staging/_stg_email_conversions.yml @@ -1,15 +1,16 @@ version: 2 - models: - name: stg_email_conversions description: Staging table for email conversion details - tags: ["staging", "customer_io"] + tags: + - staging + - customer_io columns: - - name: delivery_id - description: "Unique ID for the email delivery" - tests: - - not_null - - name: shop_subdomain - description: "Shopify subdomain" - tests: - - not_null + - name: delivery_id + description: Unique ID for the email delivery + data_tests: + - not_null + - name: shop_subdomain + description: The foreign key for the Shop. + data_tests: + - not_null diff --git a/models/customer_io/staging/_stg_email_opens.yml b/models/customer_io/staging/_stg_email_opens.yml index 13f4a3a..2a6bfd0 100644 --- a/models/customer_io/staging/_stg_email_opens.yml +++ b/models/customer_io/staging/_stg_email_opens.yml @@ -1,15 +1,16 @@ version: 2 - models: - name: stg_email_opens - description: "Email opens from Customer.io" - tags: ["staging", "customer_io"] + description: Email opens from Customer.io + tags: + - staging + - customer_io columns: - - name: delivery_id - description: "Unique ID for the email delivery" - tests: - - not_null - - name: shop_subdomain - description: "Shopify subdomain" - tests: - - not_null + - name: delivery_id + description: Unique ID for the email delivery + data_tests: + - not_null + - name: shop_subdomain + description: The foreign key for the Shop. + data_tests: + - not_null diff --git a/models/generic/_currency_conversion_rates.yml b/models/generic/_currency_conversion_rates.yml index 53f082a..ae77dbe 100644 --- a/models/generic/_currency_conversion_rates.yml +++ b/models/generic/_currency_conversion_rates.yml @@ -3,12 +3,12 @@ models: - name: currency_conversion_rates columns: - name: CURRENCY - tests: + data_tests: - not_null - unique - name: IN_USD - tests: + data_tests: - not_null - name: EXCHANGE_RATE_AT - tests: + data_tests: - not_null diff --git a/models/generic/intermediate/_int_shop_infos.yml b/models/generic/intermediate/_int_shop_infos.yml index 8ca5179..26578f3 100644 --- a/models/generic/intermediate/_int_shop_infos.yml +++ b/models/generic/intermediate/_int_shop_infos.yml @@ -1,15 +1,15 @@ version: 2 - models: - name: int_shop_infos - description: "Intermediate table for shop information" - tags: ["intermediate"] + description: Intermediate table for shop information + tags: + - intermediate columns: - name: shop_subdomain - description: Shopify subdomain - tests: + description: The foreign key for the Shop. + data_tests: - unique - name: updated_at - description: The date the shop info was updated. - tests: + description: Used to build incremental models. + data_tests: - not_null diff --git a/models/generic/staging/_stg_constellation_users.yml b/models/generic/staging/_stg_constellation_users.yml index 00dc245..52e7518 100644 --- a/models/generic/staging/_stg_constellation_users.yml +++ b/models/generic/staging/_stg_constellation_users.yml @@ -1,12 +1,13 @@ version: 2 - models: - name: stg_constellation_users - description: > - This table contains all users in the ShopPad ecosystem. - tags: ["staging"] + description: "This table contains all users in the ShopPad ecosystem. + + " + tags: + - staging columns: - name: shop_subdomain - description: Shopify subdomain - tests: + description: The foreign key for the Shop. + data_tests: - unique diff --git a/models/google_analytics/intermediate/_int_app_store_attribution_schema.yml b/models/google_analytics/intermediate/_int_app_store_attribution_schema.yml index 9854aee..c2ef013 100644 --- a/models/google_analytics/intermediate/_int_app_store_attribution_schema.yml +++ b/models/google_analytics/intermediate/_int_app_store_attribution_schema.yml @@ -1,12 +1,12 @@ version: 2 models: - name: int_app_store_attribution - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 200 columns: - name: shop_subdomain - tests: + data_tests: - unique - not_null description: The foreign key for the Shop. diff --git a/models/google_analytics/intermediate/_int_ga_first_visits_schema.yml b/models/google_analytics/intermediate/_int_ga_first_visits_schema.yml index 0132ca7..702c439 100644 --- a/models/google_analytics/intermediate/_int_ga_first_visits_schema.yml +++ b/models/google_analytics/intermediate/_int_ga_first_visits_schema.yml @@ -1,7 +1,7 @@ version: 2 models: - name: int_ga_first_visits - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 100 description: "" @@ -41,6 +41,6 @@ models: description: The locale of the first touch in the app store. - name: shop_subdomain description: The foreign key for the Shop. - tests: + data_tests: - not_null - unique diff --git a/models/google_analytics/intermediate/int_ga_app_store_page_events.yml b/models/google_analytics/intermediate/int_ga_app_store_page_events.yml index b1a64c0..6f05f87 100644 --- a/models/google_analytics/intermediate/int_ga_app_store_page_events.yml +++ b/models/google_analytics/intermediate/int_ga_app_store_page_events.yml @@ -10,7 +10,7 @@ models: - name: app_store_locale - name: app_store_detail - name: event_name - tests: + data_tests: - dbt_expectations.expect_column_distinct_count_to_be_greater_than: value: 0 row_condition: event_name = 'shopify_app_install' diff --git a/models/google_analytics/staging/_stg_anonymous_to_known_user_matching_schema.yml b/models/google_analytics/staging/_stg_anonymous_to_known_user_matching_schema.yml index 92d578a..04e5983 100644 --- a/models/google_analytics/staging/_stg_anonymous_to_known_user_matching_schema.yml +++ b/models/google_analytics/staging/_stg_anonymous_to_known_user_matching_schema.yml @@ -3,7 +3,7 @@ version: 2 models: - name: stg_anonymous_to_known_user_matching description: Matches Google anonymous IDs and shop_subdomains. May contain multiple rows for the same subdomain. - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 1000 @@ -21,5 +21,5 @@ models: description: The anonymouse Google Analytics user ID - name: SHOP_SUBDOMAIN description: The foreign key of the Shop. - tests: + data_tests: - not_null diff --git a/models/mesa/intermediate/_int_first_workflow_keys.yml b/models/mesa/intermediate/_int_first_workflow_keys.yml index d22368c..33b3e4b 100644 --- a/models/mesa/intermediate/_int_first_workflow_keys.yml +++ b/models/mesa/intermediate/_int_first_workflow_keys.yml @@ -4,7 +4,7 @@ models: columns: - name: shop_subdomain description: The foreign key for the Shop. - tests: + data_tests: - unique - not_null - name: first_workflow_trigger_app diff --git a/models/mesa/intermediate/_int_mesa_flow_events.yml b/models/mesa/intermediate/_int_mesa_flow_events.yml index 43526a2..027b88d 100644 --- a/models/mesa/intermediate/_int_mesa_flow_events.yml +++ b/models/mesa/intermediate/_int_mesa_flow_events.yml @@ -3,7 +3,7 @@ models: - name: int_mesa_flow_events columns: - name: shop_subdomain - tests: + data_tests: - not_null - relationships: to: ref('int_shops') @@ -37,7 +37,7 @@ models: - name: context_campaign_content - name: event_text - name: id - tests: + data_tests: - unique - name: properties_action - name: properties_goal @@ -79,6 +79,7 @@ models: - name: category - name: value - name: key + description: The code-friendly key of the workflow. - name: workflow_id description: The foreign key to the originating workflow - name: source diff --git a/models/mesa/intermediate/_int_mesa_shop_days.yml b/models/mesa/intermediate/_int_mesa_shop_days.yml index 937b0a2..83fb313 100644 --- a/models/mesa/intermediate/_int_mesa_shop_days.yml +++ b/models/mesa/intermediate/_int_mesa_shop_days.yml @@ -1,7 +1,7 @@ version: 2 models: - name: int_mesa_shop_days - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 1 config: @@ -12,7 +12,7 @@ models: - shop_subdomain columns: - name: shop_subdomain - tests: + data_tests: - not_null - relationships: to: ref('int_shops') @@ -21,45 +21,45 @@ models: where: mesa_plan != 'custom-app' description: The foreign key for the Shop. - name: dt - tests: + data_tests: - not_null - dbt_utils.accepted_range: max_value: current_date() description: The calendar date of the shop day. - name: workflow_runs_attempted_count - tests: + data_tests: - not_null description: The number of Workflow Run attempts that have been started. - name: workflow_runs_success_count - tests: + data_tests: - not_null description: The number of workflow runs that succeeded on this day. - name: workflow_success_percent - tests: + data_tests: - not_null description: The percentage of workflow runs that succeeded on this day. - name: billed_count - tests: + data_tests: - not_null description: "[Fill]" - name: daily_usage_revenue - tests: + data_tests: - not_null description: The amount of revenue from usage charges for this day. - name: workflow_run_success_rolling_thirty_day_count - tests: + data_tests: - not_null description: The number of successful workflow run attempts initiated in the last 30 days as of this day. - name: workflow_run_success_rolling_year_count - tests: + data_tests: - not_null description: The number of successful workflow run attempts initiated in the last year as of this day. - name: is_active - tests: + data_tests: - not_null description: Whether the shop is considered active on this day. - name: mesa_shop_days_id - tests: + data_tests: - not_null - unique description: Unique identifier for each row diff --git a/models/mesa/intermediate/_int_mesa_shop_plan_days.yml b/models/mesa/intermediate/_int_mesa_shop_plan_days.yml index 566e715..4300529 100644 --- a/models/mesa/intermediate/_int_mesa_shop_plan_days.yml +++ b/models/mesa/intermediate/_int_mesa_shop_plan_days.yml @@ -1,7 +1,7 @@ version: 2 models: - name: int_mesa_shop_plan_days - tests: + data_tests: - dbt_expectations.expect_compound_columns_to_be_unique: column_list: - dt diff --git a/models/mesa/intermediate/_int_shop_calendar.yml b/models/mesa/intermediate/_int_shop_calendar.yml index 1aaa183..a35ad34 100644 --- a/models/mesa/intermediate/_int_shop_calendar.yml +++ b/models/mesa/intermediate/_int_shop_calendar.yml @@ -1,7 +1,7 @@ version: 2 models: - name: int_shop_calendar - tests: + data_tests: - dbt_expectations.expect_compound_columns_to_be_unique: column_list: - dt @@ -9,17 +9,23 @@ models: columns: - name: shop_subdomain type: string - tests: + data_tests: - not_null description: The foreign key for the Shop. - name: dt - tests: + data_tests: - not_null + description: The calendar date of the shop day. - name: daily_plan_revenue - tests: + data_tests: - not_null + description: The amount of revenue from plan charges for this day. - name: MESA_PLAN - name: SHOPIFY_PLAN - name: is_shopify_zombie_plan - tests: + data_tests: - not_null + description: + Indicates whether the store is on a 'frozen', 'fraudulent', 'paused', + 'dormant' or 'cancelled' Shopify plan. TRUE means they are, FALSE means they + are not. diff --git a/models/mesa/intermediate/_int_shop_install_sources.yml b/models/mesa/intermediate/_int_shop_install_sources.yml index d117765..767295f 100644 --- a/models/mesa/intermediate/_int_shop_install_sources.yml +++ b/models/mesa/intermediate/_int_shop_install_sources.yml @@ -1,14 +1,14 @@ version: 2 models: - name: int_shop_install_sources - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 2000 - dbt_utils.equal_rowcount: compare_model: ref('int_shops') columns: - name: shop_subdomain - tests: + data_tests: - not_null - unique description: The foreign key for the Shop. @@ -25,7 +25,7 @@ models: - name: ga_first_touch_traffic_source_source description: The source that the shop was acquired through. - name: ga_first_touch_traffic_source_medium - tests: + data_tests: - not_null: config: where: shop_subdomain IN ('locker-toys', 'drink-renude') @@ -36,7 +36,7 @@ models: - name: ga_first_touch_traffic_source_source_medium description: The source & medium that drove the Shop's first visit. - name: is_blog_referral - tests: + data_tests: - not_null - check_boolean_values description: diff --git a/models/mesa/intermediate/_int_shop_lifespans.yml b/models/mesa/intermediate/_int_shop_lifespans.yml index d93f2b1..7c8104f 100644 --- a/models/mesa/intermediate/_int_shop_lifespans.yml +++ b/models/mesa/intermediate/_int_shop_lifespans.yml @@ -1,28 +1,28 @@ version: 2 models: - name: int_shop_lifespans - tests: + data_tests: - dbt_expectations.expect_column_pair_values_A_to_be_greater_than_B: column_A: last_dt column_B: first_dt or_equal: true config: - where: first_dt > '2022-01-01' + where: first_dt > '2022-01-01' columns: - name: shop_subdomain - tests: + data_tests: - unique - dbt_expectations.expect_column_to_exist description: The foreign key for the Shop. - name: first_dt - tests: + data_tests: - dbt_expectations.expect_column_to_exist - not_null - name: last_dt - tests: + data_tests: - dbt_expectations.expect_column_to_exist - not_null - name: LIFESPAN_LENGTH - tests: + data_tests: - dbt_expectations.expect_column_to_exist diff --git a/models/mesa/intermediate/_int_shops.yml b/models/mesa/intermediate/_int_shops.yml index 041e5f9..754b52d 100644 --- a/models/mesa/intermediate/_int_shops.yml +++ b/models/mesa/intermediate/_int_shops.yml @@ -1,12 +1,12 @@ version: 2 models: - name: int_shops - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 4000 columns: - name: currency - tests: + data_tests: - not_null - relationships_proportion: to: ref('currency_conversion_rates') @@ -15,15 +15,15 @@ models: field: currency description: The financial currency used by the shop with its customers. - name: install_status - tests: + data_tests: - not_null description: The current mesa app installation status of the shop. - name: shopify_plan_name - tests: + data_tests: - not_null description: The shopify plan used by the shop. - name: shop_subdomain - tests: + data_tests: - not_null - unique description: The foreign key for the Shop. @@ -32,7 +32,7 @@ models: - name: shopify_shop_orders_initial_count description: The 30-day order count volume at the time of app installation. - name: first_installed_at_pt - tests: + data_tests: - not_null description: The effective created at for the shop. - name: referral diff --git a/models/mesa/intermediate/_int_step_runs.yml b/models/mesa/intermediate/_int_step_runs.yml index 653fe9e..574a4a8 100644 --- a/models/mesa/intermediate/_int_step_runs.yml +++ b/models/mesa/intermediate/_int_step_runs.yml @@ -3,11 +3,11 @@ models: - name: int_step_runs columns: - name: workflow_run_id - tests: + data_tests: - not_null description: The foreign key to the Workflow Run. - name: step_run_id - tests: + data_tests: - unique - not_null description: The unique identifier for the step run. @@ -18,45 +18,45 @@ models: metabase.fk_target_field: workflow_step_id description: The foreign key to the originating workflow step. - name: step_run_at_utc - tests: + data_tests: - not_null description: The timestamp for when the step was run in UTC. - name: step_run_at_pt - tests: + data_tests: - not_null description: The timestamp for when the step was run in PT. - name: step_run_on_pt - tests: + data_tests: - not_null description: The date for when the step was run in PT. - name: step_type - tests: + data_tests: - not_null description: The type of step that was run. `input` or `output`. - name: integration_name - tests: + data_tests: - not_null description: The name of the app this step integrates with. - name: integration_key - tests: + data_tests: - not_null description: The code-friendly string of the app this step integrates with. - name: run_status - tests: + data_tests: - not_null description: The status of the step run. `success` or `failure`. - name: workflow_step_name - tests: + data_tests: - not_null description: The name of the originating workflow step. - name: workflow_step_key - tests: + data_tests: - not_null description: The code-friendly string of the workflow step. - name: tries description: The number of attempts to run the step. - name: updated_at - tests: + data_tests: - not_null description: Used to build incremental models. - name: workflow_id @@ -65,18 +65,18 @@ models: description: The customer-provided name of the originating workflow. - name: shop_subdomain description: The foreign key for the Shop. - tests: + data_tests: - not_null - relationships: to: ref('stg_shops') field: shop_subdomain - name: is_workflow_hard_deleted description: Whether the workflow was hard deleted from the database and therefore missing - tests: + data_tests: - not_null - name: position_in_workflow_run description: The chronological execution order of the step within the workflow run. - tests: + data_tests: - not_null diff --git a/models/mesa/intermediate/_int_successful_step_run_day_counts.yml b/models/mesa/intermediate/_int_successful_step_run_day_counts.yml index b23a72f..6f49f35 100644 --- a/models/mesa/intermediate/_int_successful_step_run_day_counts.yml +++ b/models/mesa/intermediate/_int_successful_step_run_day_counts.yml @@ -1,29 +1,33 @@ version: 2 models: - name: int_successful_step_run_day_counts - tests: + data_tests: - dbt_expectations.expect_compound_columns_to_be_unique: column_list: - dt - shop_subdomain columns: - name: shop_subdomain - description: The foreign key of the Shop. - tests: + description: The foreign key for the Shop. + data_tests: - not_null - name: dt - description: The date that the workflow was run. - tests: + description: The calendar date of the shop day. + data_tests: - not_null - name: total_workflow_steps_count description: The total number of Workflow Steps completed this day. - tests: + data_tests: - not_null - name: input_step_count - description: The number of "input" (aka Trigger) Workflow Steps that were run this day. - tests: + description: + The number of "input" (aka Trigger) Workflow Steps that were run + this day. + data_tests: - not_null - name: output_step_count - description: The number of "output" (aka Action) Workflow Steps that were run this day. - tests: + description: + The number of "output" (aka Action) Workflow Steps that were run + this day. + data_tests: - not_null diff --git a/models/mesa/intermediate/_int_test_runs.yml b/models/mesa/intermediate/_int_test_runs.yml index 5d28ebc..655e02c 100644 --- a/models/mesa/intermediate/_int_test_runs.yml +++ b/models/mesa/intermediate/_int_test_runs.yml @@ -5,26 +5,26 @@ models: - name: workflow_id description: The foreign key to the originating workflow - name: shop_subdomain - tests: + data_tests: - relationships: to: ref('int_shops') field: shop_subdomain description: The foreign key for the Shop. - name: test_run_id - tests: + data_tests: - unique - not_null - name: test_run_at_utc - tests: + data_tests: - not_null - name: test_run_at_pt - tests: + data_tests: - not_null - name: test_run_on_pt - tests: + data_tests: - not_null - name: run_status - tests: + data_tests: - not_null description: The status of the step run. `success` or `failure`. - name: unbillable_reason @@ -38,11 +38,11 @@ models: a step/workflow is only billed once -- not for each step. so only true for the first trigger. - name: workflow_name - tests: + data_tests: - not_null description: The customer-provided name of the originating workflow. - name: source_app - tests: + data_tests: - not_null description: The originating app that triggered the execution of the workflow @@ -50,7 +50,7 @@ models: - name: integration_key description: The code-friendly string of the app this step integrates with. - name: child_failure_count - tests: + data_tests: - not_null: config: where: test_run_at_pt > '2021-08-20' @@ -58,13 +58,13 @@ models: - name: updated_at description: Used to build incremental models. - name: is_workflow_hard_deleted - tests: + data_tests: - not_null description: Whether the workflow was hard deleted from the database and therefore missing - name: is_successful - tests: + data_tests: - not_null: config: where: test_run_at_pt > '2021-08-20' diff --git a/models/mesa/intermediate/_int_test_step_runs.yml b/models/mesa/intermediate/_int_test_step_runs.yml index c3ceef4..827ed1e 100644 --- a/models/mesa/intermediate/_int_test_step_runs.yml +++ b/models/mesa/intermediate/_int_test_step_runs.yml @@ -3,10 +3,10 @@ models: - name: int_test_step_runs columns: - name: test_run_id - tests: + data_tests: - not_null - name: test_step_run_id - tests: + data_tests: - not_null - unique - name: workflow_step_id diff --git a/models/mesa/intermediate/_int_workflow_runs.yml b/models/mesa/intermediate/_int_workflow_runs.yml index f1f9699..a28eb48 100644 --- a/models/mesa/intermediate/_int_workflow_runs.yml +++ b/models/mesa/intermediate/_int_workflow_runs.yml @@ -1,17 +1,17 @@ version: 2 models: - name: int_workflow_runs - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 1000000 columns: - name: workflow_run_id - tests: + data_tests: - not_null - unique description: The foreign key to the Workflow Run. - name: workflow_id - tests: + data_tests: - not_null - relationships_proportion: to: ref('stg_workflows') @@ -20,76 +20,76 @@ models: error_if: ">15" description: The foreign key to the originating workflow - name: shop_subdomain - tests: + data_tests: - not_null - relationships: to: ref('int_shops') field: shop_subdomain description: The foreign key for the Shop. - name: workflow_run_at_utc - tests: + data_tests: - not_null description: The timestamp of the workflow run execution in UTC. - name: workflow_run_at_pt - tests: + data_tests: - not_null description: The timestamp of the workflow run execution in PT. - name: workflow_run_on_pt - tests: + data_tests: - not_null description: The date of the workflow run execution in PT. - name: run_status - tests: + data_tests: - not_null description: The status of the step run. `success` or `failure`. - name: unbillable_reason description: The reason why a workflow run is not billable. - name: is_free_workflow - tests: + data_tests: - not_null description: Whether the workflow run was a free workflow. Free workflows are not billed. - name: is_billable - tests: + data_tests: - not_null description: a step/workflow is only billed once -- not for each step. so only true for the first trigger. - name: workflow_name - tests: + data_tests: - not_null description: The customer-provided name of the originating workflow. - name: source_app - tests: + data_tests: - not_null description: The originating app that triggered the execution of the workflow run. - name: integration_key - tests: + data_tests: - not_null description: The code-friendly string of the app this step integrates with. - name: child_failure_count - tests: + data_tests: - not_null: config: where: workflow_run_at_pt > '2021-09-17' description: The number of steps that failed in the workflow run. - name: updated_at - tests: + data_tests: - not_null description: Used to build incremental models. - name: is_workflow_hard_deleted - tests: + data_tests: - not_null description: Whether the workflow was hard deleted from the database and therefore missing - name: executed_step_count - tests: + data_tests: - not_null description: The number of steps that were executed in the workflow run. - name: is_successful - tests: + data_tests: - not_null: config: where: workflow_run_at_pt > '2021-09-17' description: Whether the workflow run was successfully until the end or a safe exit. - name: destination_app - tests: + data_tests: - not_null: config: severity: error @@ -97,7 +97,7 @@ models: warn_if: ">10" description: The final app integration at the end of the workflow run. - name: source_destination_pair - tests: + data_tests: - not_null: config: severity: error diff --git a/models/mesa/marts/_mesa_charges.yml b/models/mesa/marts/_mesa_charges.yml index 172eb03..92e2183 100644 --- a/models/mesa/marts/_mesa_charges.yml +++ b/models/mesa/marts/_mesa_charges.yml @@ -6,7 +6,7 @@ models: description: Records of usage charges for Mesa Shops. columns: - name: shop_subdomain - tests: + data_tests: - relationships: to: ref('int_shops') field: shop_subdomain @@ -19,13 +19,13 @@ models: description: The amount charged to the customer with this charge. - name: charged_at_pt description: The timestamp of the charge in PT. - tests: + data_tests: - not_null - name: charged_on_pt description: The date of the charge in PT. - tests: + data_tests: - not_null - name: charge_id description: The unique identifier of the charge. - tests: + data_tests: - unique diff --git a/models/mesa/marts/_shops.yml b/models/mesa/marts/_shops.yml index 35a99e4..304c51c 100644 --- a/models/mesa/marts/_shops.yml +++ b/models/mesa/marts/_shops.yml @@ -1,30 +1,31 @@ ---- version: 2 models: - name: shops description: formatted, production-ready shops. meta: - metabase.caveats: this table combines all the install records of `m3_mesa` into one shop record. - tests: + metabase.caveats: + this table combines all the install records of `m3_mesa` into + one shop record. + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 4000 columns: - description: The foreign key for the Shop. name: shop_subdomain - tests: + data_tests: - not_null - unique - description: The effective created at for the shop. name: first_installed_at_pt - tests: + data_tests: - not_null - description: The financial currency used by the shop with its customers. name: currency - tests: + data_tests: - not_null - description: The number of workflow runs that have completed without error. name: unique_workflows_successfully_run_count - tests: + data_tests: - not_null - description: The shopify plan used by the shop. name: shopify_plan_name @@ -106,94 +107,104 @@ models: name: hotjar_url - description: a direct link to the Shop's backdoor ui. name: backdoor_url - - description: The total minutes between the first and last pageview inside the app. + - description: + The total minutes between the first and last pageview inside the + app. name: minutes_using_app - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.7 config: where: first_installed_at_pt > '2020-12-18' - description: The number of Workflow Run attempts that have been started. name: workflow_runs_attempted_count - tests: + data_tests: - not_null - description: The timestamp of the last pageview inside the pap. name: last_seen_in_app_at_pt - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.7 - description: The number of Workflow Run attempts that have completed successfully. name: workflow_run_success_count - tests: + data_tests: - not_null - description: The minutes between initial install and the latest uninstall. name: minutes_until_uninstall - description: The timestamp of the first pageview within the app. name: first_seen_in_app_at_pt - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.7 - - description: The number of successful workflow run attempts initiated in the last 30 days as of this day. + - description: + The number of successful workflow run attempts initiated in the last + 30 days as of this day. name: workflow_run_success_rolling_thirty_day_count - tests: + data_tests: - not_null - description: The number of days from first install to activation. name: days_to_activation - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.02 - - description: The number of successful workflow run attempts initiated in the last year as of this day. + - description: + The number of successful workflow run attempts initiated in the last + year as of this day. name: workflow_run_success_rolling_year_count - description: The timestamp of the latest uninstallation of the app. name: uninstalled_at_pt - description: The date of the first plan upgrade action. name: first_plan_upgrade_date - - description: The top-level step in the funnel that the shop is currently in. + - description: The funnel phase the Shop was in when the workflow run was executed. name: funnel_phase - tests: + data_tests: - not_null - description: whether the shop has ever created a workflow or installed a template. name: has_a_workflow - tests: + data_tests: - not_null - description: The timestamp of the latest funnel step achieved in pt. name: max_funnel_step_achieved_at_pt - tests: + data_tests: - not_null - description: whether the shop has ever enabled a workflow. name: has_enabled_a_workflow - tests: + data_tests: - not_null - description: The week of the Shop's first app installation. name: cohort_week - tests: + data_tests: - not_null - description: The numeric value of latest funnel step achieved. name: max_funnel_step - tests: + data_tests: - not_null - description: The name of the latest funnel step achieved. name: max_funnel_step_name - tests: + data_tests: - not_null - description: The month of the Shop's first app installation. name: cohort_month - tests: + data_tests: - not_null - - description: The total revenue generated by users who first installed in the given week. + - description: + The total revenue generated by users who first installed in the given + week. meta: metabase.display_name: Total LTV Revenue metabase.semantic_type: type/Currency name: total_ltv_revenue - tests: + data_tests: - not_null - description: The number of currently enabled workflows for the shop. name: workflows_enabled_current_count - tests: + data_tests: - not_null - - description: The number of total workflows currently created on the shop (enabled or disabled). + - description: + The number of total workflows currently created on the shop (enabled + or disabled). name: workflows_current_count - tests: + data_tests: - not_null - description: The date the Shop's trial ended. meta: @@ -203,11 +214,13 @@ models: name: launch_session_date - description: The number of days from launch to activation. (may be negative.) meta: - metabase.caveats: this number may be negative if they activated before the launch session. + metabase.caveats: + this number may be negative if they activated before the launch + session. name: days_from_launch_session_to_activation - description: whether the shop has had a launch session with customer success. name: has_had_launch_session - tests: + data_tests: - not_null - description: The tier of the Shop's current revenue. meta: @@ -215,58 +228,62 @@ models: name: shopify_shop_gmv_current_total_tier - description: whether the shop has an account for this app. name: has_uploadery - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_tracktor - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_blogstudio - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_kitkarts - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_smile - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_bouncer - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_pagestudio - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_coin - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: whether the shop has an account for this app. name: has_infinite_options - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - - description: The template the Shop intended to use when they first installed the app. + - description: + The template the Shop intended to use when they first installed the + app. name: acq_acquisition_template - - description: Whether the Shop was referred/entered the marketing site by a blog post. + - description: + Whether the Shop was referred/entered the marketing site by a blog + post. name: acq_is_blog_referral - tests: + data_tests: - not_null - description: The number of workflow attempts that have been started. name: unique_workflows_attempted_count - tests: + data_tests: - not_null - description: The 30-day order count volume at the time of app installation. name: shopify_shop_orders_initial_count @@ -280,7 +297,9 @@ models: name: shopify_shop_orders_current_count - description: The age (in weeks) of the store at the initial install. name: age_of_store_at_install_in_weeks - - description: The first full category/sub-category group of the Shop pulled in from Store Leads. + - description: + The first full category/sub-category group of the Shop pulled in + from Store Leads. meta: metabase.display_name: Shopify Shop Product Category & Subcategory (Store Leads) name: store_leads_category @@ -292,11 +311,15 @@ models: meta: metabase.display_name: Shopify Shop Features (Store Leads) name: store_leads_features - - description: Indicates whether the Shop has Recharge listed in their Store Leads features. + - description: + Indicates whether the Shop has Recharge listed in their Store Leads + features. meta: metabase.display_name: Has Recharge? (Store Leads) name: store_leads_has_recharge - - description: The rank of the Shop on the platform (Shopify) pulled in from Store Leads. + - description: + The rank of the Shop on the platform (Shopify) pulled in from Store + Leads. meta: metabase.display_name: Shopify Store Rank (Store Leads) name: store_leads_platform_rank @@ -309,36 +332,50 @@ models: metabase.display_name: Estimated Shop Sales (Store Leads) metabase.semantic_type: type/Currency name: store_leads_estimated_monthly_sales - - description: The estimated amount the Shop spends on Shopify apps (pulled in from Store Leads).†≤ + - description: + "The estimated amount the Shop spends on Shopify apps (pulled in\ + \ from Store Leads).\u2020\u2264" meta: metabase.display_name: Monthly App Spend (Store Leads) metabase.semantic_type: type/Currency name: store_leads_monthly_app_spend - description: The country of the Shop provided by the Shopify API. name: shopify_shop_country - - description: The bucket of the Shop's estimated monthly sales pulled in from Store Leads. + - description: + The bucket of the Shop's estimated monthly sales pulled in from Store + Leads. meta: metabase.display_name: Estimated Monthly Sales Bucket (Store Leads) name: store_leads_estimated_monthly_sales_bucket - - description: The ShopPad revenue attributed to the Shop from Mesa in the last 30 days. + - description: + The ShopPad revenue attributed to the Shop from Mesa in the last + 30 days. meta: metabase.display_name: Last 30-Day Income metabase.semantic_type: type/Currency name: income_rolling_thirty_day_total - - description: The ShopPad revenue attributed to the Shop from Mesa in the last year. + - description: + The ShopPad revenue attributed to the Shop from Mesa in the last + year. meta: metabase.display_name: Last Year Income metabase.semantic_type: type/Currency name: income_rolling_year_total - - description: Whether the Shop is a custom application with custom pricing not billed through the Shopify system. + - description: + Whether the Shop is a custom application with custom pricing not + billed through the Shopify system. name: is_custom_app - tests: + data_tests: - not_null - - description: The percent comparison of the Shop's initial revenue compared to its cohort. + - description: + The percent comparison of the Shop's initial revenue compared to + its cohort. meta: metabase.display_name: Shopify Shop GMV Compared to Cohort Avg (Install) name: shopify_shop_gmv_initial_cohort_avg_percent - - description: The percent comparison of the Shop's current revenue compared to all other Shops. + - description: + The percent comparison of the Shop's current revenue compared to + all other Shops. meta: metabase.display_name: Shopify Shop GMV Compared to All Avg (Current) name: shopify_shop_gmv_current_cohort_avg_percent @@ -380,15 +417,21 @@ models: name: last_broadcast_email_converted_at_pt - description: The timestamp of the Shop's first install in the constellation. name: first_in_constellation_at_utc - - description: The date of the Shop's first install in the constellation apart from MESA. + - description: + The date of the Shop's first install in the constellation apart from + MESA. meta: metabase.display_name: First In Constellation On (PT) name: first_in_constellation_on_pt - - description: The timestamp of the Shop's first install in the constellation apart from MESA. + - description: + The timestamp of the Shop's first install in the constellation apart + from MESA. meta: metabase.display_name: First In Constellation At (PT) name: first_in_constellation_at_pt - - description: The week of the Shop's first install in the constellation apart from MESA. + - description: + The week of the Shop's first install in the constellation apart from + MESA. meta: metabase.display_name: Constellation Cohort Week name: constellation_cohort_week @@ -422,13 +465,13 @@ models: meta: metabase.display_name: Is In Trial? name: is_in_trial - tests: + data_tests: - not_null - description: Whether the Shop has ever upgraded to a paid plan. meta: metabase.display_name: Ever Upgraded to Paid Plan? name: has_ever_upgraded_to_paid_plan - tests: + data_tests: - not_null - description: The identifier of the Shop's first plan. name: first_plan_identifier @@ -440,97 +483,152 @@ models: meta: metabase.display_name: Is Currently Paying? name: is_currently_paying - tests: + data_tests: - not_null - dbt_expectations.expect_column_distinct_count_to_equal: value: 2 - - description: Whether the Shop's currency is not supported in the DBT/Snowflake currency conversion data. + - description: + Whether the Shop's currency is not supported in the DBT/Snowflake + currency conversion data. meta: metabase.display_name: Currency Not Supported? name: currency_not_supported - tests: + data_tests: - not_null - - description: Indicates whether the store is on a 'frozen', 'fraudulent', 'paused', 'dormant' or 'cancelled' Shopify plan. TRUE means they are, FALSE means they are not. + - description: + Indicates whether the store is on a 'frozen', 'fraudulent', 'paused', + 'dormant' or 'cancelled' Shopify plan. TRUE means they are, FALSE means they + are not. meta: metabase.display_name: Is Zombie Shopify Plan? name: is_shopify_zombie_plan - tests: + data_tests: - not_null - - description: The number of successful workflow run attempts initiated in the last year as of this day. + - description: + The number of workflow run attempts initiated in the last year as + of this day. name: workflow_run_attempt_rolling_year_count - - description: The average daily usage revenue for the Shop (calculated by the average of the last 30 billable days). + - description: + The average daily usage revenue for the Shop (calculated by the average + of the last 30 billable days). name: average_daily_usage_revenue - - description: The number of successful workflow run attempts initiated in the last 30 days as of this day. + - description: + The number of workflow run attempts initiated in the last 30 days + as of this day. name: workflow_run_attempt_rolling_thirty_day_count - - description: The total number of Workflow Steps started in the last 30 days as of Yesterday. + - description: + The total number of Workflow Steps started in the last 30 days as + of Yesterday. name: input_step_rolling_thirty_day_count - tests: + data_tests: - not_null - - description: The total number of "input" (Trigge) Workflow Steps completed in the last 30 days as of Yesterday. + - description: + The total number of "input" (Trigge) Workflow Steps completed in + the last 30 days as of Yesterday. name: output_step_rolling_thirty_day_count - tests: + data_tests: - not_null - - description: The total number of Workflow Steps completed in the last 30 days as of Yesterday. + - description: + The total number of Workflow Steps completed in the last 30 days + as of Yesterday. name: total_workflow_steps_rolling_thirty_day_count - tests: + data_tests: - not_null - - description: The key of the first step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The key of the first step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_trigger_key - description: The total revenue for the Shop in the last 30 days as of Yesterday. name: total_thirty_day_revenue - tests: + data_tests: - not_null - - description: The app of the first step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The app of the first step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_trigger_app - - description: The key of the last step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The key of the last step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_destination_key - - description: The app of the last step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The app of the last step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_destination_app - - description: The name of the last step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The name of the last step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_destination_name - - description: The average daily revenue for the Shop (calculated by the average of the last 30 billable days). + - description: + The average daily revenue for the Shop (calculated by the average + of the last 30 billable days). name: average_daily_revenue - - description: The name of the first step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The name of the first step in the Shop's first workflow. Gives a + clue to their MESA use case. name: first_workflow_trigger_name - description: The number of unique integration apps enabled for the Shop. name: integration_apps_enabled_count - tests: + data_tests: - not_null - description: The number of unique pro apps enabled in workflows for the Shop. name: pro_apps_enabled_count - tests: + data_tests: - not_null - - description: The sort title of the first workflow in the Shop. (Cleaned title or marked as DELETED.) + - description: + The sort title of the first workflow in the Shop. (Cleaned title + or marked as DELETED.) name: first_workflow_sort_title - - description: The app pair of the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The app pair of the Shop's first workflow. Gives a clue to their + MESA use case. name: first_workflow_trigger_destination_app_pair - - description: The key pair of the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The key pair of the Shop's first workflow. Gives a clue to their + MESA use case. name: first_workflow_trigger_destination_key_pair - - description: The name of the last step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The name of the last step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_destination_name - - description: The name of the first step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The name of the first step in the Shop's first workflow. Gives a + clue to their MESA use case. name: first_workflow_trigger_name - description: The maximum number of steps in any workflow for the Shop. name: max_workflow_steps - tests: + data_tests: - not_null - - description: The title of the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The title of the Shop's first workflow. Gives a clue to their MESA + use case. name: first_workflow_title - description: Whether the Shop is using any pro apps. name: is_using_pro_apps - tests: + data_tests: - not_null - - description: The key of the first step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The key of the first step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_trigger_key - - description: The app of the last step in the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The app of the last step in the Shop's first workflow. Gives a clue + to their MESA use case. name: first_workflow_destination_app - - description: The name pair of the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The name pair of the Shop's first workflow. Gives a clue to their + MESA use case. name: first_workflow_trigger_destination_name_pair - - description: The app chain of the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The app chain of the Shop's first workflow. Gives a clue to their + MESA use case. name: first_workflow_app_chain - - description: The step chain of the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The step chain of the Shop's first workflow. Gives a clue to their + MESA use case. name: first_workflow_step_chain - - description: The ID of the Shop's first workflow. Gives a clue to their MESA use case. + - description: + The ID of the Shop's first workflow. Gives a clue to their MESA use + case. name: first_workflow_id - description: Whether the Shop has ever installed Coin. name: has_ever_installed_coin @@ -538,7 +636,7 @@ models: name: has_shoppad_constellation_app - description: The number of times the Shop has changed plans. name: plan_change_count - tests: + data_tests: - not_null - description: Whether the Shop has ever installed Infinite Options. name: has_ever_installed_infinite_options @@ -556,45 +654,67 @@ models: name: has_ever_installed_pagestudio - description: Whether the Shop has ever installed Blog Studio. name: has_ever_installed_blogstudio - - description: Whether the Shop installed another Shoppad app before installing their first Shoppad Constellation app. + - description: + Whether the Shop installed another Shoppad app before installing + their first Shoppad Constellation app. name: did_install_another_shoppad_app_first - description: Whether the Shop has ever installed Uploadery. name: has_ever_installed_uploadery - description: The first Shoppad app installed by the Shop. name: first_shoppad_app_installed - - description: Whether the Shop has ever paid for a plan and then downgraded to the free plan. + - description: + Whether the Shop has ever paid for a plan and then downgraded to + the free plan. name: did_pay_and_then_downgrade_to_free - description: The v10 plan the Shop's usage qualifies for. name: virtual_plan - tests: + data_tests: - not_null - - description: The qualifier for the Shop's virtual plan based on their workflow run attempts/triggers. + - description: + The qualifier for the Shop's virtual plan based on their workflow + run attempts/triggers. name: virtual_plan_workflow_run_attempt_qualifier - - description: The qualifier for the Shop's virtual plan based on their pro app usage. + - description: + The qualifier for the Shop's virtual plan based on their pro app + usage. name: virtual_plan_pro_app_qualifier - - description: The qualifier for the Shop's virtual plan based on their workflow step usage. + - description: + The qualifier for the Shop's virtual plan based on their workflow + step usage. name: virtual_plan_step_qualifier - description: The number of workflow runs that have resulted in Stop. name: workflow_runs_stop_count - tests: + data_tests: - not_null - - description: Whether the Shop is likely a Shopify Plus dev store and therefore not valuable. + - description: + Whether the Shop is likely a Shopify Plus dev store and therefore + not valuable. name: is_likely_shopify_plus_dev_store - - description: The number of workflow runs that have resulted in Failure in the last year. + - description: + The number of workflow runs that have resulted in Failure in the + last year. name: workflow_run_failure_rolling_year_count - - description: The number of workflow runs that have resulted in Stop in the last year. + - description: + The number of workflow runs that have resulted in Stop in the last + year. name: workflow_run_stop_rolling_year_count - - description: The number of workflow runs that have resulted in Stop in the last 30 days. + - description: + The number of workflow runs that have resulted in Stop in the last + 30 days. name: workflow_run_stop_rolling_thirty_day_count - description: The number of workflow runs that have resulted in Failure. name: workflow_runs_fail_count - - description: The number of workflow runs that have resulted in Failure in the last 30 days. + - description: + The number of workflow runs that have resulted in Failure in the + last 30 days. name: workflow_run_failure_rolling_thirty_day_count - description: The name of the email the Shop unsubscribed from. name: email_unsubscribe_email_name - description: The date/time the Shop installed their first Shoppad app. name: first_shoppad_app_installed_at_pt - - description: Whether the Shop was acquired via email/email played a role in their journey. + - description: + Whether the Shop was acquired via email/email played a role in their + journey. name: is_email_acquisition - description: Whether the Shop has unsubscribed from email. name: has_unsubscribed_from_email @@ -602,7 +722,7 @@ models: name: first_shoppad_app_installed_at_utc - description: Their daily average MRR multiplied by 30. name: projected_mrr - tests: + data_tests: - not_null - description: The date the Shop received their first newsletter. name: first_newsletter_sent_on_pt @@ -620,7 +740,9 @@ models: description: Whether the Shop has churned during trial. - description: The identifier of the Shop's first trial plan. name: first_trial_plan_identifier - - description: The status of the Shop's plan upgrade funnel through trial, paying and churn. + - description: + The status of the Shop's plan upgrade funnel through trial, paying + and churn. name: plan_upgrade_funnel_status - description: The name of the first journey email the Shop received. name: first_journey_sent_name @@ -648,10 +770,10 @@ models: name: churned_customer_duration_in_days - description: The date the Shop churned. name: churned_on_pt - tests: + data_tests: - not_null: config: - where: "NOT is_custom_app AND has_churned_paid" + where: NOT is_custom_app AND has_churned_paid error_if: ">100" - description: The number of weeks the Shop has been/was on a paid plan. name: churned_customer_duration_in_weeks @@ -659,15 +781,17 @@ models: name: churned_customer_duration_in_months - description: Whether the Shop has ever saved a workflow. name: has_saved_a_workflow - tests: + data_tests: - not_null - - description: The maximum number of steps in any workflow for the Shop, including deleted steps. + - description: + The maximum number of steps in any workflow for the Shop, including + deleted steps. name: max_workflow_steps_with_deleted - tests: + data_tests: - not_null - description: Whether the Shop has ever successfully run a test. name: has_successfully_run_a_test - tests: + data_tests: - not_null - description: The number of times the Shop has been over their billing limit. name: billing_overage_last_count @@ -675,35 +799,43 @@ models: name: overlimit_date_pt - description: Whether the Shop has ever attempted to run a test. name: has_attempted_a_test - tests: + data_tests: - not_null - description: The Shop's income amount from yesterday. name: yesterdays_inc_amount - tests: + data_tests: - not_null - description: The currency of the Shop's analytics. name: analytics_currency - description: Whether the Shop is a PQL. name: is_pql - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - description: The apps used by the Shop. name: apps_used - - description: The apps used by the Shop, excluding glue apps such as "filter". (See project var['glue_apps']) + - description: + The apps used by the Shop, excluding glue apps such as "filter". + (See project var['glue_apps']) name: apps_used_without_glue - description: Whether the Shop has a workflow with a PUC step. name: has_puc_workflow - tests: + data_tests: - not_null - - description: A list of the Shop's source/destination app pairs from all workflows (enabled or not). + - description: + A list of the Shop's source/destination app pairs from all workflows + (enabled or not). name: source_destination_pairs_list - - description: Whether the Shop has CSM support and exists in our Book-of-Business (BOB) + - description: + Whether the Shop has CSM support and exists in our Book-of-Business + (BOB) name: has_csm_support - tests: + data_tests: - not_null - name: shop_value_per_month - description: The estimated monetary value of the shop on a monthly basis. Currently plan price. + description: + The estimated monetary value of the shop on a monthly basis. Currently + plan price. - description: The timestamp of the last update to the shop in Pacific Time. name: shopify_last_updated_at_pt - name: average_plan_revenue @@ -776,3 +908,9 @@ models: description: The type of churn event. - name: acq_unified_landing_page_type description: The type of landing page during acquisition. + - name: app_store_reviewed_at_pt + description: The timestamp of the Shop's review of MESA in the app store in Pacific Time. + - name: app_store_review_requested_at_pt + description: The timestamp of when we sent the Shop a request to review MESA in the app store in Pacific Time. + - name: has_app_store_reviewed + description: Whether the Shop has reviewed MESA in the app store. diff --git a/models/mesa/marts/_step_runs.yml b/models/mesa/marts/_step_runs.yml index e91dee5..9e93e6d 100644 --- a/models/mesa/marts/_step_runs.yml +++ b/models/mesa/marts/_step_runs.yml @@ -3,18 +3,18 @@ models: - name: step_runs description: "individual mesa workflow step executions." - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 10000 columns: - name: step_run_id description: The unique identifier for the step run. - tests: + data_tests: - not_null - unique - name: workflow_run_id description: The foreign key to the Workflow Run. - tests: + data_tests: - not_null - relationships_proportion: to: ref('workflow_runs') @@ -22,14 +22,14 @@ models: error_if: ">1" - name: workflow_id description: The foreign key to the originating workflow - tests: + data_tests: - not_null - relationships: to: ref('workflows') field: workflow_id - name: shop_subdomain description: The foreign key for the Shop. - tests: + data_tests: - not_null - relationships: to: ref('shops') @@ -40,7 +40,7 @@ models: metabase.semantic_type: type/FK metabase.fk_target_table: ref('workflow_steps') metabase.fk_target_field: workflow_step_id - tests: + data_tests: - not_null: config: where: step_run_at_utc > '2021-08-20' @@ -56,23 +56,23 @@ models: where: step_run_at_utc > '2021-08-20' - name: step_run_at_utc description: The timestamp for when the step was run in UTC. - tests: + data_tests: - not_null - name: step_run_at_pt description: The timestamp for when the step was run in PT. - tests: + data_tests: - not_null - name: step_run_on_pt description: The date for when the step was run in PT. - tests: + data_tests: - not_null - name: step_type description: The type of step that was run. `input` or `output`. - tests: + data_tests: - not_null - name: run_status description: The status of the step run. `success` or `failure`. - tests: + data_tests: - not_null - accepted_values: values: ["success", "fail", "replayed", "running", "stop"] @@ -80,15 +80,15 @@ models: description: The number of attempts to run the step. - name: updated_at description: Used to build incremental models. - tests: + data_tests: - not_null - name: workflow_step_name description: The name of the originating workflow step. - tests: + data_tests: - not_null - name: workflow_step_key description: The code-friendly string of the workflow step. - tests: + data_tests: - not_null - name: position_in_workflow_run description: The chronological execution order of the step within the workflow run. diff --git a/models/mesa/marts/_workflow_runs.yml b/models/mesa/marts/_workflow_runs.yml index 2895906..a9b54da 100644 --- a/models/mesa/marts/_workflow_runs.yml +++ b/models/mesa/marts/_workflow_runs.yml @@ -2,7 +2,7 @@ version: 2 models: - name: workflow_runs description: individual mesa workflow executions. - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 10000 - dbt_expectations.expect_table_row_count_to_be_between: @@ -16,17 +16,17 @@ models: row_condition: is_free_workflow columns: - name: workflow_run_id - tests: + data_tests: - not_null description: The foreign key to the Workflow Run. - name: is_billable description: a step/workflow is only billed once -- not for each step. so only true for the first trigger. - tests: + data_tests: - not_null - name: shop_subdomain - tests: + data_tests: - not_null - relationships: to: ref('shops') @@ -43,22 +43,22 @@ models: - name: workflow_id description: The foreign key to the originating workflow - name: workflow_run_at_utc - tests: + data_tests: - not_null description: The timestamp of the workflow run execution in UTC. - name: workflow_run_at_pt description: The timestamp of the workflow run execution in PT. - tests: + data_tests: - not_null - name: workflow_run_on_pt description: The date of the workflow run execution in PT. - tests: + data_tests: - not_null - name: unbillable_reason description: The reason why a workflow run is not billable. meta: metabase.caveats: Seems to often say that billing is not set up when it is. - tests: + data_tests: - not_null: where: not(is_billable) - name: source_app @@ -69,11 +69,11 @@ models: description: Used to build incremental models. - name: executed_step_count description: The number of steps that were executed in the workflow run. - tests: + data_tests: - not_null - name: child_failure_count description: The number of steps that failed in the workflow run. - tests: + data_tests: - not_null: config: where: workflow_run_on_pt > '2021-09-20' @@ -81,7 +81,7 @@ models: description: Whether the workflow run was successfully until the end or a safe exit. - tests: + data_tests: - not_null: config: where: workflow_run_on_pt > '2021-09-20' @@ -97,7 +97,7 @@ models: description: Whether the workflow run was a free workflow. Free workflows are not billed. - tests: + data_tests: - not_null - name: is_workflow_hard_deleted description: @@ -113,30 +113,30 @@ models: description: The funnel phase the Shop was in when the workflow run was executed. - name: did_end_with_delay description: Whether the workflow run ended with a delay. - tests: + data_tests: - not_null - name: child_complete_count description: The number of steps that completed in the workflow run. - tests: + data_tests: - not_null: config: where: WORKFLOW_RUN_AT_UTC > '2022-12-06' - name: did_move_data description: Whether the workflow run moved data. - tests: + data_tests: - not_null: config: where: workflow_run_at_utc > '2022-12-06' - name: was_filter_stopped description: Whether the workflow run was stopped by a filter. - tests: + data_tests: - not_null: config: where: workflow_run_at_utc > '2022-12-06' - name: child_stop_count description: The number of steps that were stopped in the workflow run. - tests: + data_tests: - not_null: config: where: WORKFLOW_RUN_AT_UTC > '2022-12-06' diff --git a/models/mesa/marts/_workflow_steps.yml b/models/mesa/marts/_workflow_steps.yml index 003a396..cebd36e 100644 --- a/models/mesa/marts/_workflow_steps.yml +++ b/models/mesa/marts/_workflow_steps.yml @@ -3,17 +3,20 @@ models: - name: workflow_steps description: This table contains the individual Steps of a Workflow. meta: - metabase.caveats: | - Some records are for Deleted Workflows, so be sure to filter on is_deleted. + metabase.caveats: + "Some records are for Deleted Workflows, so be sure to filter + on is_deleted. + + " columns: - name: workflow_step_id - description: Unique identifier for each workflow step. - tests: + description: The foreign key to the originating workflow step. + data_tests: - unique - not_null - name: shop_subdomain - description: Subdomain of the shop where the workflow step is executed. - tests: + description: The foreign key for the Shop. + data_tests: - not_null - relationships: to: ref('shops') @@ -21,23 +24,23 @@ models: - name: integration_app description: The app integrated with the workflow step. - name: workflow_id - description: Identifier of the workflow that the step belongs to. - tests: + description: The foreign key to the originating workflow + data_tests: - not_null - relationships: to: ref('workflows') field: workflow_id - name: step_type - description: Type of the workflow step. - tests: + description: The type of step that was run. `input` or `output`. + data_tests: - not_null - name: step_weight description: Weight of the workflow step. - name: position_in_workflow description: Position of the step in the workflow. - name: is_deleted - description: Flag indicating if the workflow step is deleted. - tests: + description: Whether the workflow has been deleted by the Shop. + data_tests: - not_null - name: created_at_pt description: Timestamp when the workflow step was created. @@ -55,3 +58,11 @@ models: description: Success rate of the workflow step. - name: run_count_failure description: Number of failed runs of the workflow step. + - name: step_custom_name + description: Custom name of the workflow step. + - name: operation_id + description: The operation id of the workflow step. + - name: metadata + description: Metadata of the workflow step. + - name: description + description: Description of the workflow step. diff --git a/models/mesa/marts/_workflows.yml b/models/mesa/marts/_workflows.yml index 61111ca..c614688 100644 --- a/models/mesa/marts/_workflows.yml +++ b/models/mesa/marts/_workflows.yml @@ -12,13 +12,13 @@ models: " columns: - name: workflow_id - description: The unique identifier for the workflow. - tests: + description: The foreign key to the originating workflow + data_tests: - unique - not_null - name: shop_subdomain - description: The foreign key of the Shop. - tests: + description: The foreign key for the Shop. + data_tests: - not_null - relationships: field: shop_subdomain @@ -27,72 +27,72 @@ models: description: The name of the template the workflow originated from. - name: title description: The title of the workflow. - tests: + data_tests: - not_null - name: is_premium description: Whether the workflow is premium or not. - tests: + data_tests: - not_null - name: description description: The Shop-provided description of the workflow. - tests: + data_tests: - not_null - name: key description: The code-friendly key of the workflow. - tests: + data_tests: - not_null - name: tags description: The tags associated with the workflow. - tests: + data_tests: - not_null - name: step_count description: The current number of steps in the workflow. - tests: + data_tests: - dbt_utils.accepted_range: max_value: 100 - name: first_run_at_pt description: The timestamp of the first run of the workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.1 - name: first_successful_run_at_pt description: The timestamp of the first successful run of the workflow in PT. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.1 - name: trigger_count description: The number of times the workflow has been run. - tests: + data_tests: - not_null - name: run_success_count description: The number of times the workflow has been run successfully. - tests: + data_tests: - not_null - name: run_success_percent description: The percent of workflow run attempts that successfully ran. - name: is_enabled description: Whether the workflow is currently enabled or not. - tests: + data_tests: - not_null - name: first_test_at_pt description: The timestamp of the first test attempt of the workflow in PT. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.1 - name: first_successful_test_at_pt description: The timestamp of the first successful test attempt of the workflow in PT. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.1 - name: test_attempt_count description: The number of times the workflow has had a test attempt. - tests: + data_tests: - not_null - name: test_success_count description: The number of times the workflow has had a successful test attempt. - tests: + data_tests: - not_null - name: test_success_percent description: The percent of test attempts that have completed successfully. @@ -100,51 +100,51 @@ models: description: Whether the workflow has been edited or saved. Determined by presence of `workflow_save` and `dashboard_workflow_edit` events. - tests: + data_tests: - not_null - name: has_viewed_workflow description: Whether the workflow has been viewed. Determined by presence of Pageview of the workflow's URL. - tests: + data_tests: - not_null - name: has_enabled_workflow description: Whether the workflow has been enabled. Determined by presence of `workflow_enable` event featuring the workflow_id. - tests: + data_tests: - not_null - name: created_at_pt description: The timestamp of the workflow's creation in PT. - tests: + data_tests: - not_null - name: updated_at_pt description: The timestamp of the workflow's last update in PT. - tests: + data_tests: - not_null - name: enable_count description: The number of times the workflow has been enabled. - tests: + data_tests: - not_null - name: save_count description: The number of times the workflow has been saved. - tests: + data_tests: - not_null - name: has_test_attempted_workflow description: Whether the workflow has had a test attempt. - tests: + data_tests: - not_null - name: has_test_succeeded_workflow description: Whether the workflow has had a successful test attempt. - tests: + data_tests: - not_null - name: page_view_count description: The number of times the workflow has been viewed. - tests: + data_tests: - not_null - name: is_deleted description: Whether the workflow has been deleted by the Shop. - tests: + data_tests: - not_null - name: setup description: The stage of a template-wizard workflow setup process. @@ -198,12 +198,12 @@ models: description: The app that triggered the workflow. - name: created_on_pt description: The timestamp of the workflow's creation in PT. - tests: + data_tests: - not_null - name: source_destination_pair - description: The source and destination apps in the workflow. + description: The source and destination app integration in one string. - name: destination_app - description: The destination app in the workflow. + description: The final app integration at the end of the workflow run. - name: is_from_template description: Whether the workflow was created from a template. - name: deleted_step_count @@ -216,13 +216,21 @@ models: description: The current number of steps in the workflow, including deleted steps. - name: is_puc description: Whether the workflow is a PUC workflow. - tests: + data_tests: - not_null - name: is_created_by_shoppad description: Whether the workflow was created by Shoppad. - tests: + data_tests: - not_null - name: created_by description: The user who created the workflow. - name: step_descriptions description: The descriptions of the steps in the workflow. + - name: destination_operation_id + description: The operation id of the destination app in the workflow. + - name: trigger_operation_id + description: The operation id of the trigger app in the workflow. + - name: trigger_step_name + description: The name of the trigger step in the workflow. + - name: destination_step_name + description: The name of the destination step in the workflow. diff --git a/models/mesa/marts/rollups/_mesa_growth_accounting.yml b/models/mesa/marts/rollups/_mesa_growth_accounting.yml index 6175edf..301c73d 100644 --- a/models/mesa/marts/rollups/_mesa_growth_accounting.yml +++ b/models/mesa/marts/rollups/_mesa_growth_accounting.yml @@ -7,11 +7,11 @@ models: columns: - name: month description: The month of the User Growth Accounting. - tests: + data_tests: - unique - name: mau description: The number of paying Shops in the month. - tests: + data_tests: - not_null meta: metabase.display_name: Monthly Active Shops @@ -19,7 +19,7 @@ models: - name: retained description: The amount of pre-existing paying Shops that previously paid before the period. - tests: + data_tests: - not_null meta: metabase.display_name: Retained Shops @@ -27,7 +27,7 @@ models: - name: new description: The amount of new paying Shops this period. - tests: + data_tests: - not_null meta: metabase.display_name: New Active Shops @@ -35,7 +35,7 @@ models: - name: resurrected description: The amount of pre-existing paying Shops this period who were not active in the last period. - tests: + data_tests: - not_null meta: metabase.display_name: Resurrected Shops @@ -43,7 +43,7 @@ models: - name: churned description: The amount of Shops paying in the last period who didn't pay this period. - tests: + data_tests: - not_null meta: metabase.display_name: Churned Shops diff --git a/models/mesa/marts/rollups/_mesa_monthly_revenue_accounting.yml b/models/mesa/marts/rollups/_mesa_monthly_revenue_accounting.yml index 3349acd..f80286d 100644 --- a/models/mesa/marts/rollups/_mesa_monthly_revenue_accounting.yml +++ b/models/mesa/marts/rollups/_mesa_monthly_revenue_accounting.yml @@ -4,54 +4,54 @@ models: columns: - name: month description: The calendar month of the data. - tests: + data_tests: - unique - not_null - name: rev description: The total revenue for the month. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Total Revenue - name: retained description: The revenue from Shops that were active in the previous month. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Retained Revenue - name: new description: The revenue from Shops that were active for this first time in this month. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: New Shop Revenue - name: expansion description: The additional revenue from Shops that were active in the previous month, but had a higher revenue in this month. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Additional Revenue from Existing Shops - name: resurrected description: The revenue from existing Shops that were not active in the previous month, but were active in this month. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Revenue Gain from Resurrected Shops - name: contraction description: The revenue lost from Shops that were active in the previous month, but had a lower revenue in this month. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Revenue Lost from Existing Shops - name: churned description: The revenue lost from Shops that were active in the previous month, but were not active in this month. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency diff --git a/models/mesa/marts/rollups/_mesa_quarterly_revenue_accounting.yml b/models/mesa/marts/rollups/_mesa_quarterly_revenue_accounting.yml index 30b1a6e..e0eac53 100644 --- a/models/mesa/marts/rollups/_mesa_quarterly_revenue_accounting.yml +++ b/models/mesa/marts/rollups/_mesa_quarterly_revenue_accounting.yml @@ -4,83 +4,83 @@ models: columns: - name: quarter description: The quarter of the year - tests: + data_tests: - not_null - name: rev description: The total revenue for the quarter - tests: + data_tests: - not_null - name: net_new_rev description: The net new revenue for the quarter - tests: + data_tests: - not_null - name: retained description: The retained revenue for the quarter - tests: + data_tests: - not_null - name: new description: The new revenue for the quarter - tests: + data_tests: - not_null - name: expansion description: The expansion revenue for the quarter - tests: + data_tests: - not_null - name: resurrected description: The resurrected revenue for the quarter - tests: + data_tests: - not_null - name: contraction description: The contraction revenue for the quarter - tests: + data_tests: - not_null - name: churned description: The churned revenue for the quarter - tests: + data_tests: - not_null - name: customer_count description: The number of customers for the quarter - tests: + data_tests: - not_null - name: arpu description: The average revenue per user for the quarter - tests: + data_tests: - not_null - name: revenue_churn_rate description: The revenue churn rate for the quarter - tests: + data_tests: - not_null - name: resurrected_customer_count description: The number of resurrected customers for the quarter - tests: + data_tests: - not_null - name: customer_churn_rate description: The customer churn rate for the quarter - tests: + data_tests: - not_null - name: rev_growth_rate description: The revenue growth rate for the quarter - tests: + data_tests: - not_null - name: retained_customer_count description: The number of retained customers for the quarter - tests: + data_tests: - not_null - name: customer_growth_rate description: The customer growth rate for the quarter - tests: + data_tests: - not_null - name: churned_customer_count description: The number of churned customers for the quarter - tests: + data_tests: - not_null - name: new_customer_count description: The number of new customers for the quarter - tests: + data_tests: - not_null - name: lost_revenue description: The lost revenue for the quarter - tests: + data_tests: - not_null - name: predictive_ltv description: The predictive LTV for the quarter diff --git a/models/mesa/marts/rollups/_mesa_shop_days.yml b/models/mesa/marts/rollups/_mesa_shop_days.yml index 0ab6419..9fcfb94 100644 --- a/models/mesa/marts/rollups/_mesa_shop_days.yml +++ b/models/mesa/marts/rollups/_mesa_shop_days.yml @@ -1,12 +1,21 @@ version: 2 models: - name: mesa_shop_days - description: > - The "DAU" table. This table contains a row for each day that a shop has some kind of "usage" (e.g. a workflow run, a plan charge, etc.) in the system. This table is used to calculate metrics like "daily active shops" and "daily active shops by cohort". + description: + 'The "DAU" table. This table contains a row for each day that a shop + has some kind of "usage" (e.g. a workflow run, a plan charge, etc.) in the system. + This table is used to calculate metrics like "daily active shops" and "daily active + shops by cohort". + + ' meta: - metabase.caveats: > - This table contains records for non-paying Shops. A record is created if they run a workflow *or* if they have a plan charge or anything else interesting. - tests: + metabase.caveats: + "This table contains records for non-paying Shops. A record + is created if they run a workflow *or* if they have a plan charge or anything + else interesting. + + " + data_tests: - dbt_expectations.expect_compound_columns_to_be_unique: column_list: - dt @@ -16,7 +25,7 @@ models: columns: - name: shop_subdomain description: The foreign key for the Shop. - tests: + data_tests: - not_null - relationships: to: ref('shops') @@ -25,78 +34,82 @@ models: where: NOT(shop_subdomain ILIKE '%dev%') - name: dt description: The calendar date of the shop day. - tests: + data_tests: - not_null - dbt_utils.accepted_range: max_value: getdate() - name: workflow_runs_success_count description: The number of workflow runs that succeeded on this day. - tests: + data_tests: - not_null - name: workflow_success_percent description: The percentage of workflow runs that succeeded on this day. - tests: + data_tests: - not_null - name: billed_count description: "[Fill]" - tests: + data_tests: - not_null - name: daily_usage_revenue description: The amount of revenue from usage charges for this day. - tests: + data_tests: - not_null - name: is_active description: Whether the shop is considered active on this day. - tests: + data_tests: - not_null - name: workflow_run_success_rolling_thirty_day_count - description: The number of successful workflow run attempts initiated in the last 30 days as of this day. - tests: + description: + The number of successful workflow run attempts initiated in the last + 30 days as of this day. + data_tests: - not_null - name: workflow_run_success_rolling_year_count - description: The number of successful workflow run attempts initiated in the last year as of this day. - tests: + description: + The number of successful workflow run attempts initiated in the last + year as of this day. + data_tests: - not_null - name: daily_plan_revenue description: The amount of revenue from plan charges for this day. - tests: + data_tests: - not_null - name: inc_amount description: The revenue attributed to this shop for this day. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency - name: workflow_runs_attempted_count description: The number of Workflow Run attempts that have been started. - tests: + data_tests: - not_null - name: mesa_shop_days_id description: Unique identifier for each row - tests: + data_tests: - not_null - unique - name: cohort_month description: The month of the Shop's first app installation. - tests: + data_tests: - not_null - name: cohort_week description: The week of the Shop's first app installation. - tests: + data_tests: - not_null - name: mesa_plan description: The Mesa billing plan the Shop was on that day. - name: shopify_plan description: The Shopify plan the Shop was on that day. - tests: + data_tests: - not_null - name: income_rolling_year_total description: The total revenue from this shop in the last year as of this day. - tests: + data_tests: - not_null - name: income_rolling_thirty_day_total description: The total revenue from this shop in the last 30 days as of this day. - tests: + data_tests: - not_null - name: workflows_wizard_complete_count description: The number of times the template wizard was completed on this day. @@ -105,11 +118,15 @@ models: - name: workflows_wizard_started_count description: The number of times the template wizard was started on this day. - name: workflows_wizard_incomplete_count - description: The number of times the template wizard was started but not completed on this day. + description: + The number of times the template wizard was started but not completed + on this day. - name: has_incomplete_wizard description: Whether the shop has an incomplete wizard on this day. - name: created_workflow_without_wizard - description: Whether the shop created a workflow without using the wizard on this day. + description: + Whether the shop created a workflow without using the wizard on this + day. - name: created_a_workflow description: Whether the shop created a workflow on this day. - name: started_wizard @@ -117,34 +134,61 @@ models: - name: completed_wizard description: Whether the shop completed the wizard on this day. - name: workflows_created_without_wizard_count - description: The number of workflows created without using the wizard on this day. + description: + The number of workflows created without using the wizard on this + day. - name: is_in_trial description: Whether the shop is in a trial on this day. - tests: + data_tests: - not_null - name: is_shopify_zombie_plan - description: Whether the shop is on a zombie plan on this day. - tests: + description: + Indicates whether the store is on a 'frozen', 'fraudulent', 'paused', + 'dormant' or 'cancelled' Shopify plan. TRUE means they are, FALSE means they + are not. + data_tests: - not_null - name: mesa_plan_identifier description: The Mesa plan identifier for the shop on this day. - name: workflow_run_attempt_rolling_thirty_day_count - description: The number of workflow run attempts initiated in the last 30 days as of this day. - tests: + description: + The number of workflow run attempts initiated in the last 30 days + as of this day. + data_tests: - not_null - name: workflow_run_attempt_rolling_year_count - description: The number of workflow run attempts initiated in the last year as of this day. - tests: + description: + The number of workflow run attempts initiated in the last year as + of this day. + data_tests: - not_null - name: input_step_count description: The number of trigger steps executed on this day. - name: input_step_rolling_thirty_day_count - description: The number of trigger steps executed in the last 30 days as of this day. + description: + The number of trigger steps executed in the last 30 days as of this + day. - name: output_step_count description: The number of action steps executed on this day. - name: output_step_rolling_thirty_day_count - description: The number of action steps executed in the last 30 days as of this day. + description: + The number of action steps executed in the last 30 days as of this + day. - name: total_workflow_steps_count description: The number of workflow steps executed on this day. - name: total_workflow_steps_rolling_thirty_day_count - description: The number of workflow steps executed in the last 30 days as of this day. + description: + The number of workflow steps executed in the last 30 days as of this + day. + - name: workflow_run_stop_rolling_thirty_day_count + description: The number of workflow runs that were stopped in the last 30 days as of this day. + - name: workflow_run_stop_rolling_year_count + description: The number of workflow runs that were stopped in the last year as of this day. + - name: workflow_runs_stop_count + description: The number of workflow runs that were stopped on this day. + - name: workflow_runs_failure_count + description: The number of workflow runs that failed on this day. + - name: workflow_run_failure_rolling_thirty_day_count + description: The number of workflow runs that failed in the last 30 days as of this day. + - name: workflow_run_failure_rolling_year_count + description: The number of workflow runs that failed in the last year as of this day. diff --git a/models/mesa/marts/rollups/_mesa_shop_monthly_cohort_performance.yml b/models/mesa/marts/rollups/_mesa_shop_monthly_cohort_performance.yml index 7158f78..575eb94 100644 --- a/models/mesa/marts/rollups/_mesa_shop_monthly_cohort_performance.yml +++ b/models/mesa/marts/rollups/_mesa_shop_monthly_cohort_performance.yml @@ -9,99 +9,99 @@ models: columns: - name: cohort_month description: The month of the Shop's first app installation. - tests: + data_tests: - not_null - unique - name: cohort_size description: The number of users who first installed in the given month. - tests: + data_tests: - not_null - name: total_ltv_revenue description: The total revenue generated by users who first installed in the given - month. - tests: + week. + data_tests: - not_null - name: has_a_workflow_count description: The number of users who first installed in the given month and have a workflow. - tests: + data_tests: - not_null - name: has_enabled_a_workflow_count description: The number of users who first installed in the given month and have enabled a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - name: is_activated_count description: The number of users who first installed in the given month and are activated. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - name: has_a_workflow_pct description: The percentage of users who first installed in the given month and have a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: workflow_enabling_incremental_pct description: The percentage of users who first installed in the given month and have enabled a workflow, compared to only having a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: workflow_enabling_cohort_pct description: The percentage of users who first installed in the given month and have enabled a workflow, compared to the cohort size. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: activation_cohort_pct description: The percentage of users who first installed in the given month and are activated, compared to the cohort size. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: activation_incremental_pct description: The percentage of users who first installed in the given month and are activated, compared to only enabling a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: lifetime_value_installed description: The average revenue generated by users who first installed in the given month. - tests: + data_tests: - not_null - name: lifetime_value_has_a_workflow description: The average revenue generated by users who first installed in the given month and have a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: lifetime_value_enabled_workflow description: The average revenue generated by users who first installed in the given month and have enabled a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: lifetime_value_activated description: The average revenue generated by users who first installed in the given month and are activated. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: is_activated_count @@ -204,7 +204,6 @@ models: description: The percentage of users who first installed in the given month and have enabled a workflow, compared to the cohort size. - - name: has_workflow_first_year_count description: The number of users who first installed in the given month and have @@ -393,3 +392,5 @@ models: description: The percentage of users who have a Shopify Basic plan. - name: shopify_shopify_plus_plan_count description: The number of users who have a Shopify Plus plan. + - name: has_done_a_trial_count + - name: ever_did_trial_pct diff --git a/models/mesa/marts/rollups/_mesa_shop_weekly_cohort_performance.yml b/models/mesa/marts/rollups/_mesa_shop_weekly_cohort_performance.yml index fbd5631..9b83195 100644 --- a/models/mesa/marts/rollups/_mesa_shop_weekly_cohort_performance.yml +++ b/models/mesa/marts/rollups/_mesa_shop_weekly_cohort_performance.yml @@ -9,99 +9,99 @@ models: columns: - name: cohort_week description: The week of the Shop's first app installation. - tests: + data_tests: - not_null - unique - name: cohort_size description: The number of users who first installed in the given week. - tests: + data_tests: - not_null - name: total_ltv_revenue description: The total revenue generated by users who first installed in the given week. - tests: + data_tests: - not_null - name: has_a_workflow_count description: The number of users who first installed in the given week and have a workflow. - tests: + data_tests: - not_null - name: has_enabled_a_workflow_count description: The number of users who first installed in the given week and have enabled a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - name: is_activated_count description: The number of users who first installed in the given week and are activated. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.9 - name: has_a_workflow_pct description: The percentage of users who first installed in the given week and have a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: workflow_enabling_incremental_pct description: The percentage of users who first installed in the given week and have enabled a workflow, compared to only having a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: workflow_enabling_cohort_pct description: The percentage of users who first installed in the given week and have enabled a workflow, compared to the cohort size. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: activation_cohort_pct description: The percentage of users who first installed in the given week and are activated, compared to the cohort size. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: activation_incremental_pct description: The percentage of users who first installed in the given week and are activated, compared to only enabling a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: lifetime_value_installed description: The average revenue generated by users who first installed in the given week. - tests: + data_tests: - not_null - name: lifetime_value_has_a_workflow description: The average revenue generated by users who first installed in the given week and have a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: lifetime_value_enabled_workflow description: The average revenue generated by users who first installed in the given week and have enabled a workflow. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: lifetime_value_activated description: The average revenue generated by users who first installed in the given week and are activated. - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 - name: is_activated_count @@ -428,3 +428,7 @@ models: description: The percentage of MQLs who are not in the Mesa segment averaged over trailing 4 weeks. - name: normalized_mql_growth description: The growth rate of MQLs normalized by the growth rate of the constellation. + - name: has_done_a_trial_count + description: The number of users who first installed in the given week and have done a trial. + - name: ever_did_trial_pct + description: The percentage of users who first installed in the given week and have done a trial. diff --git a/models/mesa/marts/rollups/_mesa_weekly_revenue_accounting.yml b/models/mesa/marts/rollups/_mesa_weekly_revenue_accounting.yml index 057562a..fc6b640 100644 --- a/models/mesa/marts/rollups/_mesa_weekly_revenue_accounting.yml +++ b/models/mesa/marts/rollups/_mesa_weekly_revenue_accounting.yml @@ -4,54 +4,54 @@ models: columns: - name: week description: The calendar week of the data. - tests: + data_tests: - unique - not_null - name: rev description: The total revenue for the week. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Total Revenue - name: retained description: The revenue from Shops that were active in the previous week. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Retained Revenue - name: new description: The revenue from Shops that were active for this first time in this week. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: New Shop Revenue - name: expansion description: The additional revenue from Shops that were active in the previous week, but had a higher revenue in this week. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Additional Revenue from Existing Shops - name: resurrected description: The revenue from existing Shops that were not active in the previous week, but were active in this week. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Revenue Gain from Resurrected Shops - name: contraction description: The revenue lost from Shops that were active in the previous week, but had a lower revenue in this week. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency metabase.display_name: Revenue Lost from Existing Shops - name: churned description: The revenue lost from Shops that were active in the previous week, but were not active in this week. - tests: + data_tests: - not_null meta: metabase.semantic_type: type/Currency diff --git a/models/mesa/marts/rollups/_monthly_cohort_performance.yml b/models/mesa/marts/rollups/_monthly_cohort_performance.yml index d4d7e0c..19f3059 100644 --- a/models/mesa/marts/rollups/_monthly_cohort_performance.yml +++ b/models/mesa/marts/rollups/_monthly_cohort_performance.yml @@ -3,7 +3,7 @@ version: 2 models: - name: monthly_cohort_performance description: "This table breaks paying shops into cohorts based on when they starrted to pay and into monthly revenue performance" - tests: + data_tests: - dbt_expectations.expect_compound_columns_to_be_unique: column_list: - first_month @@ -11,45 +11,45 @@ models: columns: - name: first_month description: "The first month the Shop paid us." - tests: + data_tests: - not_null - name: active_month description: "The month of the performance." - tests: + data_tests: - not_null - name: months_since_first description: "The number of the period after the first paying month." - tests: + data_tests: - not_null - name: shops description: "The count of Shops that paid this month." - tests: + data_tests: - not_null - name: cohort_num_users description: "The total count of the cohort's Shops at the beginning" - tests: + data_tests: - not_null - name: retained_pctg description: "The percent of Shops that paid this month compared to the total cohort." - tests: + data_tests: - not_null - name: inc_amt description: "The revenue of this cohort in this month." - tests: + data_tests: - not_null - name: cum_amt description: "The sum total of all cohort revenue up through this period." - tests: + data_tests: - not_null - name: cum_amt_per_user description: "The average revenue per Shop in this cohort up to this period." - tests: + data_tests: - not_null diff --git a/models/mesa/marts/rollups/_monthly_subscriber_retentions.yml b/models/mesa/marts/rollups/_monthly_subscriber_retentions.yml index e60810d..23a9d16 100644 --- a/models/mesa/marts/rollups/_monthly_subscriber_retentions.yml +++ b/models/mesa/marts/rollups/_monthly_subscriber_retentions.yml @@ -1,7 +1,7 @@ version: 2 models: - name: monthly_subscriber_retentions - tests: + data_tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - cohort_month @@ -16,7 +16,7 @@ models: - name: period description: Period of the cohort - name: cohort_month - description: Month of the cohort + description: The month of the Shop's first app installation. - name: retained_shops description: Number of retained shops - name: cohort_info diff --git a/models/mesa/marts/rollups/_weekly_subscriber_retention.yml b/models/mesa/marts/rollups/_weekly_subscriber_retention.yml index c17c844..aa9bc56 100644 --- a/models/mesa/marts/rollups/_weekly_subscriber_retention.yml +++ b/models/mesa/marts/rollups/_weekly_subscriber_retention.yml @@ -1,7 +1,7 @@ version: 2 models: - name: weekly_subscriber_retention - tests: + data_tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - cohort_week @@ -12,7 +12,7 @@ models: - name: retained_shops description: Number of retained shops - name: cohort_week - description: Week of the cohort + description: The week of the Shop's first app installation. - name: revenue_retention_rate description: Revenue retention rate of shops - name: retained_mrr diff --git a/models/mesa/shop_attribution.yml b/models/mesa/shop_attribution.yml index b62e0ea..130e738 100644 --- a/models/mesa/shop_attribution.yml +++ b/models/mesa/shop_attribution.yml @@ -4,7 +4,7 @@ models: columns: - name: shop_subdomain description: The foreign key for the Shop. - tests: + data_tests: - not_null - name: unified_traffic_source description: The source of the traffic that led to the shop. @@ -31,7 +31,9 @@ models: - name: unified_referrer_host description: The host that referred the user to the shop. - name: is_blog_referral - description: Whether the Shop was referred/entered the marketing site by a blog post. + description: + Whether the Shop was referred/entered the marketing site by a blog + post. - name: days_to_install description: The number of days it took for the user to install the app after @@ -40,7 +42,7 @@ models: description: Indicates whether the referral to the shop came from an app store search ad. - tests: + data_tests: - not_null - name: referrer_medium description: The medium of the referrer that led the user to the shop. @@ -134,7 +136,7 @@ models: name: ga_first_touch_referrer_host - description: The medium that the shop was acquired through. name: ga_first_touch_traffic_source_medium - - description: The source of the traffic source during the first touch event. + - description: The source that the shop was acquired through. name: ga_first_touch_traffic_source_source - description: The intra position of the app store surface during the app store diff --git a/models/mesa/sources.yml b/models/mesa/sources.yml index f7643f0..5578757 100644 --- a/models/mesa/sources.yml +++ b/models/mesa/sources.yml @@ -42,14 +42,14 @@ sources: columns: - name: _id description: unique identifier for the task. - tests: + data_tests: - unique - not_null - name: created_at description: do not use. this column is sometimes null. - name: _created_at description: The time the task was created. - tests: + data_tests: - not_null - name: shops @@ -59,16 +59,16 @@ sources: columns: - name: _id description: unique identifier for the shop account. - tests: + data_tests: - unique - not_null - name: _created_at description: The time the shop account was created by installing the app. - tests: + data_tests: - not_null - name: uuid description: The shopify subdomain of the shop account. - tests: + data_tests: - not_null - name: mesa_charges @@ -76,11 +76,11 @@ sources: columns: - name: _id description: unique identifier for the charge. - tests: + data_tests: - unique - not_null - name: created_at - tests: + data_tests: - not_null - name: mesa_install_records identifier: m3_mesa_installs diff --git a/models/mesa/staging/_calendar_dates.yml b/models/mesa/staging/_calendar_dates.yml index fd9ba0d..90ff8b0 100644 --- a/models/mesa/staging/_calendar_dates.yml +++ b/models/mesa/staging/_calendar_dates.yml @@ -5,6 +5,6 @@ models: columns: - name: date_day description: The calendar day. - tests: + data_tests: - unique - not_null diff --git a/models/mesa/staging/_stg_legacy_daus.yml b/models/mesa/staging/_stg_legacy_daus.yml index 1224e10..11f543d 100644 --- a/models/mesa/staging/_stg_legacy_daus.yml +++ b/models/mesa/staging/_stg_legacy_daus.yml @@ -5,9 +5,9 @@ models: columns: - name: shop_subdomain description: The foreign key for the Shop. - tests: + data_tests: - not_null - name: dt description: The calendar date of the shop day. - tests: + data_tests: - not_null diff --git a/models/mesa/staging/_stg_mesa_billing_accounts.yml b/models/mesa/staging/_stg_mesa_billing_accounts.yml index b24612a..7d7264e 100644 --- a/models/mesa/staging/_stg_mesa_billing_accounts.yml +++ b/models/mesa/staging/_stg_mesa_billing_accounts.yml @@ -1,31 +1,33 @@ version: 2 models: - name: stg_mesa_billing_accounts - tests: + data_tests: - dbt_utils.equal_rowcount: compare_model: ref('shops') columns: - name: SHOP_subdomain - tests: + data_tests: - unique - not_null - name: BILLING_METHOD_NAME - tests: + data_tests: - not_null - accepted_values: - values: ["shopify", "chargebee"] + values: + - shopify + - chargebee - name: daily_plan_revenue - description: The revenue generated from the plan on a daily basis. + description: The amount of revenue from plan charges for this day. - name: balance_used description: The amount of the plan's balance that has been used. - name: shopify_id - description: The unique identifier for the shop in Shopify. + description: The official shopify identifier for the shop. - name: plan_price description: The price of the plan. - name: plan_used description: The extent to which the plan's resources have been utilized. - name: status - description: The current status of the billing account. + description: The usage status of the shop. - name: percent_complete description: The percentage of the plan period that has been completed. - name: billing_on_pt diff --git a/models/mesa/staging/_stg_mesa_charges.yml b/models/mesa/staging/_stg_mesa_charges.yml index da39a15..218b879 100644 --- a/models/mesa/staging/_stg_mesa_charges.yml +++ b/models/mesa/staging/_stg_mesa_charges.yml @@ -3,7 +3,7 @@ models: - name: stg_mesa_charges columns: - name: charge_id - tests: + data_tests: - unique description: The unique identifier of the charge. - name: shop_subdomain @@ -15,10 +15,10 @@ models: - name: billed_amount description: The amount charged to the customer with this charge. - name: charged_at_pt - tests: + data_tests: - not_null description: The timestamp of the charge in PT. - name: charged_on_pt - tests: + data_tests: - not_null description: The date of the charge in PT. diff --git a/models/mesa/staging/_stg_mesa_flow_events.yml b/models/mesa/staging/_stg_mesa_flow_events.yml index 396ad48..b6fb8f4 100644 --- a/models/mesa/staging/_stg_mesa_flow_events.yml +++ b/models/mesa/staging/_stg_mesa_flow_events.yml @@ -3,7 +3,7 @@ models: - name: stg_mesa_flow_events columns: - name: shop_subdomain - tests: + data_tests: - not_null description: The foreign key for the Shop. - name: properties_step_label @@ -34,7 +34,7 @@ models: - name: context_campaign_content - name: event_text - name: mesa_flow_event_id - tests: + data_tests: - unique - not_null - name: properties_action @@ -76,6 +76,7 @@ models: - name: category - name: value - name: key + description: The code-friendly key of the workflow. - name: workflow_id description: The foreign key to the originating workflow - name: source diff --git a/models/mesa/staging/_stg_mesa_install_records_schema.yml b/models/mesa/staging/_stg_mesa_install_records_schema.yml index bf0a9e6..f428c53 100644 --- a/models/mesa/staging/_stg_mesa_install_records_schema.yml +++ b/models/mesa/staging/_stg_mesa_install_records_schema.yml @@ -1,12 +1,12 @@ version: 2 models: - name: stg_mesa_install_records - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 200 columns: - name: shop_subdomain - tests: + data_tests: - unique - not_null description: The foreign key for the Shop. diff --git a/models/mesa/staging/_stg_shop_entitlements.yml b/models/mesa/staging/_stg_shop_entitlements.yml index f836390..74255ce 100644 --- a/models/mesa/staging/_stg_shop_entitlements.yml +++ b/models/mesa/staging/_stg_shop_entitlements.yml @@ -3,10 +3,10 @@ models: - name: stg_shop_entitlements columns: - name: shop_subdomain - tests: + data_tests: - not_null description: The foreign key for the Shop. - name: name - name: value - name: status - description: The usage status of the Shop. + description: The usage status of the shop. diff --git a/models/mesa/staging/_stg_shop_infos.yml b/models/mesa/staging/_stg_shop_infos.yml index 3eab582..ab5c426 100644 --- a/models/mesa/staging/_stg_shop_infos.yml +++ b/models/mesa/staging/_stg_shop_infos.yml @@ -6,6 +6,7 @@ models: type: string length: 255 primary: true - tests: + data_tests: - not_null - unique + description: The foreign key for the Shop. diff --git a/models/mesa/staging/_stg_shops.yml b/models/mesa/staging/_stg_shops.yml index 7841aa0..41f3aa4 100644 --- a/models/mesa/staging/_stg_shops.yml +++ b/models/mesa/staging/_stg_shops.yml @@ -2,12 +2,12 @@ version: 2 models: - name: stg_shops description: '{{ doc("staging_shops") }}' - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 4000 columns: - name: shop_subdomain - tests: + data_tests: - not_null - unique description: The foreign key for the Shop. @@ -23,11 +23,11 @@ models: description: a field used by account services to record onboarding sessions. - name: handle - name: first_installed_at_pt - tests: + data_tests: - not_null description: The effective created at for the shop. - name: latest_installed_at_pt - tests: + data_tests: - not_null description: The most recent app installation date. - name: mongoid @@ -43,12 +43,12 @@ models: - name: metabase - name: schema - name: uninstalled_at_pt - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 description: The timestamp of the latest uninstallation of the app. - name: minutes_until_uninstall - tests: + data_tests: - dbt_utils.not_null_proportion: at_least: 0.5 description: The minutes between initial install and the latest uninstall. diff --git a/models/mesa/staging/_stg_step_runs.yml b/models/mesa/staging/_stg_step_runs.yml index 049ca60..ffb13df 100644 --- a/models/mesa/staging/_stg_step_runs.yml +++ b/models/mesa/staging/_stg_step_runs.yml @@ -1,17 +1,17 @@ version: 2 models: - name: stg_step_runs - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 1000000 columns: - name: step_run_id - tests: + data_tests: - not_null - unique description: The unique identifier for the step run. - name: workflow_run_id - tests: + data_tests: - not_null description: The foreign key to the Workflow Run. - name: workflow_id @@ -19,7 +19,7 @@ models: metabase.semantic_type: type/FK metabase.fk_target_table: ref('stg_workflows') metabase.fk_target_field: workflow_id - tests: + data_tests: - not_null - relationships_proportion: to: ref('stg_workflows') @@ -28,15 +28,15 @@ models: error_if: ">5" description: The foreign key to the originating workflow - name: step_run_at_utc - tests: + data_tests: - not_null description: The timestamp for when the step was run in UTC. - name: step_run_at_pt - tests: + data_tests: - not_null description: The timestamp for when the step was run in PT. - name: workflow_step_name - tests: + data_tests: - not_null description: The name of the originating workflow step. - name: workflow_step_key @@ -46,7 +46,7 @@ models: metabase.semantic_type: type/FK metabase.fk_target_table: ref('stg_workflow_steps') metabase.fk_target_field: workflow_step_id - tests: + data_tests: - not_null: warn_if: ">1" error_if: ">50" @@ -60,30 +60,33 @@ models: config: where: step_run_at_utc > '2021-08-20' - name: STEP_RUN_ON_PT - tests: + data_tests: - not_null - name: step_type - tests: + data_tests: - not_null description: The type of step that was run. `input` or `output`. - name: RUN_STATUS - tESTS: + data_tests: - not_null - name: TRIES - name: UPDATED_AT - name: SHOP_SUBDOMAIN - tests: + data_tests: - not_null - relationships: to: ref('stg_shops') field: shop_subdomain + description: The foreign key of the Shop. - name: is_workflow_hard_deleted - tests: + data_tests: - not_null - description: Whether the workflow was hard deleted from the database and therefore missing + description: + Whether the workflow was hard deleted from the database and therefore + missing - name: INTEGRATION_NAME - name: WORKFLOW_NAME - name: INTEGRATION_KEY - name: is_test_run - tests: + data_tests: - not_null diff --git a/models/mesa/staging/_stg_workflow_runs.yml b/models/mesa/staging/_stg_workflow_runs.yml index 72f92c8..054f73b 100644 --- a/models/mesa/staging/_stg_workflow_runs.yml +++ b/models/mesa/staging/_stg_workflow_runs.yml @@ -4,22 +4,22 @@ models: description: a intermediate model that isolates the very first step executed of each workflow run. - tests: + data_tests: - dbt_expectations.expect_table_row_count_to_be_between: min_value: 100000 columns: - name: workflow_run_id - tests: + data_tests: - not_null description: The foreign key to the Workflow Run. - name: is_billable description: a step/workflow is only billed once -- not for each step. so only true for the first trigger. - tests: + data_tests: - not_null - name: shop_subdomain - tests: + data_tests: - not_null - relationships: to: ref('stg_shops') @@ -35,19 +35,19 @@ models: - not_null description: The status of the step run. `success` or `failure`. - name: workflow_id - tests: + data_tests: - not_null description: The foreign key to the originating workflow - name: workflow_run_at_utc - tests: + data_tests: - not_null description: The timestamp of the workflow run execution in UTC. - name: workflow_run_at_pt - tests: + data_tests: - not_null description: The timestamp of the workflow run execution in PT. - name: workflow_run_on_pt - tests: + data_tests: - not_null description: The date of the workflow run execution in PT. - name: unbillable_reason @@ -57,11 +57,11 @@ models: The originating app that triggered the execution of the workflow run. - name: updated_at - tests: + data_tests: - not_null description: Used to build incremental models. - name: is_workflow_hard_deleted - tests: + data_tests: - not_null description: Whether the workflow was hard deleted from the database and therefore @@ -77,5 +77,5 @@ models: - name: workflow_name description: The customer-provided name of the originating workflow. - name: is_test_run - tests: + data_tests: - not_null diff --git a/models/mesa/staging/_stg_workflows.yml b/models/mesa/staging/_stg_workflows.yml index 371a532..5cf8fb3 100644 --- a/models/mesa/staging/_stg_workflows.yml +++ b/models/mesa/staging/_stg_workflows.yml @@ -3,18 +3,21 @@ models: - name: stg_workflows columns: - name: workflow_id - tests: + data_tests: - unique - not_null + description: The foreign key to the originating workflow - name: shop_subdomain - tests: + data_tests: - not_null - relationships: field: shop_subdomain to: ref('stg_shops') + description: The foreign key for the Shop. - name: template_name description: The name of the template the workflow originated from. - name: SHOP_SUBDOMAIN + description: The foreign key of the Shop. - name: TITLE - name: IS_PREMIUM - name: DESCRIPTION diff --git a/models/mesa_segment/staging/_stg_shopify_plan_changes.yml b/models/mesa_segment/staging/_stg_shopify_plan_changes.yml index 251038d..78eec11 100644 --- a/models/mesa_segment/staging/_stg_shopify_plan_changes.yml +++ b/models/mesa_segment/staging/_stg_shopify_plan_changes.yml @@ -3,14 +3,14 @@ models: - name: stg_shopify_plan_changes columns: - name: shop_subdomain - tests: + data_tests: - not_null description: The foreign key for the Shop. - name: plan - name: oldplan - name: plandisplayname - name: shopify_plan_change_id - tests: + data_tests: - not_null # - unique - name: changed_at_pt