From 9f92f5cbf5a9e8ae5fa397107000b11d52f39c8f Mon Sep 17 00:00:00 2001 From: Will Deng Date: Tue, 3 Sep 2024 14:19:33 -0400 Subject: [PATCH 1/2] Updated metric_input_measure to reflect correctly on what it can be --- schemas/latest/dbt_yml_files-latest.json | 41 ++++++++++++++---------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 46d4e2f..baf6fee 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -1753,29 +1753,36 @@ "additionalProperties": false }, "metric_input_measure": { - "type": "object", - "properties": { - "name": { + "oneOf": [ + { "type": "string" }, - "fill_nulls_with": { - "anyOf": [ - { + { + "type": "object", + "properties": { + "name": { "type": "string" }, - { - "type": "integer" + "fill_nulls_with": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "filter": { + "type": "string" + }, + "join_to_timespine": { + "type": "boolean" } - ] - }, - "filter": { - "type": "string" - }, - "join_to_timespine": { - "type": "boolean" + }, + "additionalProperties": false } - }, - "additionalProperties": false + ] }, "metric_input_schema": { "type": "object", From 190685b0575c1ade389459912e5a23abd533c797 Mon Sep 17 00:00:00 2001 From: Will Deng Date: Wed, 4 Sep 2024 12:43:33 -0400 Subject: [PATCH 2/2] Added test --- tests/latest/valid/dbt_yml_files.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/latest/valid/dbt_yml_files.yml b/tests/latest/valid/dbt_yml_files.yml index 1b07fe1..4072930 100644 --- a/tests/latest/valid/dbt_yml_files.yml +++ b/tests/latest/valid/dbt_yml_files.yml @@ -216,6 +216,15 @@ metrics: filter: | {{ Dimension('customer__customer_type') }} = 'new' + - name: recurring_customer + description: Unique count of recurring customers. + label: Recurring Customers + type: simple + type_params: + measure: customers_with_orders + filter: | + {{ Dimension('customer__customer_type') }} = 'recurring' + - name: average_transaction_total_us description: "The average total for each transaction in the US" label: Transaction Total Average US