Merged PR 4357: Propagates in Host Resolutions and Invoiced Revenue the new business scope

# Description

Changes:
* Business scope is now propagated in Host Resolutions and Invoiced Revenue Monthly/MTD Metric and Aggregated models

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [X] I have checked for DRY opportunities with other models and docs.
- [X] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #27356
This commit is contained in:
Oriol Roqué Paniagua 2025-02-12 08:17:44 +00:00
parent 78707ef649
commit edddb0ac37
6 changed files with 78 additions and 4 deletions

View file

@ -143,6 +143,8 @@ Provides a general assignement for the Dimensions available for each KPI
"GUEST_JOURNEYS_WITH_PAYMENT", "GUEST_JOURNEYS_WITH_PAYMENT",
"GUEST_PAYMENTS", "GUEST_PAYMENTS",
"STARTED_GUEST_JOURNEYS", "STARTED_GUEST_JOURNEYS",
"INVOICED_REVENUE",
"HOST_RESOLUTIONS",
] %} ] %}
{% set additional_dimensions = additional_dimensions + [dim_business_scope()] %} {% set additional_dimensions = additional_dimensions + [dim_business_scope()] %}
{% endif %} {% endif %}

View file

@ -4,6 +4,7 @@
unique_key=[ unique_key=[
"end_date", "end_date",
"id_deal", "id_deal",
"business_scope",
"active_accommodations_per_deal_segmentation", "active_accommodations_per_deal_segmentation",
], ],
) )
@ -14,6 +15,7 @@ select
d.first_day_month as start_date, d.first_day_month as start_date,
d.date as end_date, d.date as end_date,
hr.id_deal, hr.id_deal,
hr.business_scope,
hr.active_accommodations_per_deal_segmentation, hr.active_accommodations_per_deal_segmentation,
-- Dimensions -- -- Dimensions --
hr.main_billing_country_iso_3_per_deal, hr.main_billing_country_iso_3_per_deal,
@ -27,4 +29,4 @@ left join
{{ ref("int_kpis__metric_daily_host_resolutions") }} hr {{ ref("int_kpis__metric_daily_host_resolutions") }} hr
on date_trunc('month', hr.date)::date = d.first_day_month on date_trunc('month', hr.date)::date = d.first_day_month
where d.is_end_of_month = true and hr.id_deal is not null where d.is_end_of_month = true and hr.id_deal is not null
group by 1, 2, 3, 4, 5 group by 1, 2, 3, 4, 5, 6

View file

@ -4,6 +4,7 @@
unique_key=[ unique_key=[
"end_date", "end_date",
"id_deal", "id_deal",
"business_scope",
"active_accommodations_per_deal_segmentation", "active_accommodations_per_deal_segmentation",
], ],
) )
@ -14,6 +15,7 @@ select
d.first_day_month as start_date, d.first_day_month as start_date,
d.date as end_date, d.date as end_date,
ir.id_deal, ir.id_deal,
ir.business_scope,
ir.active_accommodations_per_deal_segmentation, ir.active_accommodations_per_deal_segmentation,
-- Dimensions -- -- Dimensions --
ir.main_billing_country_iso_3_per_deal, ir.main_billing_country_iso_3_per_deal,
@ -56,4 +58,4 @@ left join
{{ ref("int_kpis__metric_daily_invoiced_revenue") }} ir {{ ref("int_kpis__metric_daily_invoiced_revenue") }} ir
on date_trunc('month', ir.date)::date = d.first_day_month on date_trunc('month', ir.date)::date = d.first_day_month
where d.is_end_of_month = true and ir.id_deal is not null where d.is_end_of_month = true and ir.id_deal is not null
group by 1, 2, 3, 4, 5 group by 1, 2, 3, 4, 5, 6

View file

@ -4,6 +4,7 @@
unique_key=[ unique_key=[
"end_date", "end_date",
"id_deal", "id_deal",
"business_scope",
"active_accommodations_per_deal_segmentation", "active_accommodations_per_deal_segmentation",
], ],
) )
@ -14,6 +15,7 @@ select
d.first_day_month as start_date, d.first_day_month as start_date,
d.date as end_date, d.date as end_date,
hr.id_deal, hr.id_deal,
hr.business_scope,
hr.active_accommodations_per_deal_segmentation, hr.active_accommodations_per_deal_segmentation,
-- Dimensions -- -- Dimensions --
hr.main_billing_country_iso_3_per_deal, hr.main_billing_country_iso_3_per_deal,
@ -28,4 +30,4 @@ left join
on date_trunc('month', hr.date)::date = d.first_day_month on date_trunc('month', hr.date)::date = d.first_day_month
and extract(day from hr.date) <= d.day and extract(day from hr.date) <= d.day
where d.is_month_to_date = true and hr.id_deal is not null where d.is_month_to_date = true and hr.id_deal is not null
group by 1, 2, 3, 4, 5 group by 1, 2, 3, 4, 5, 6

View file

@ -4,6 +4,7 @@
unique_key=[ unique_key=[
"end_date", "end_date",
"id_deal", "id_deal",
"business_scope",
"active_accommodations_per_deal_segmentation", "active_accommodations_per_deal_segmentation",
], ],
) )
@ -14,6 +15,7 @@ select
d.first_day_month as start_date, d.first_day_month as start_date,
d.date as end_date, d.date as end_date,
ir.id_deal, ir.id_deal,
ir.business_scope,
ir.active_accommodations_per_deal_segmentation, ir.active_accommodations_per_deal_segmentation,
-- Dimensions -- -- Dimensions --
ir.main_billing_country_iso_3_per_deal, ir.main_billing_country_iso_3_per_deal,
@ -57,4 +59,4 @@ left join
on date_trunc('month', ir.date)::date = d.first_day_month on date_trunc('month', ir.date)::date = d.first_day_month
and extract(day from ir.date) <= d.day and extract(day from ir.date) <= d.day
where d.is_month_to_date = true and ir.id_deal is not null where d.is_month_to_date = true and ir.id_deal is not null
group by 1, 2, 3, 4, 5 group by 1, 2, 3, 4, 5, 6

View file

@ -3814,6 +3814,7 @@ models:
The unique key corresponds to: The unique key corresponds to:
- end_date, - end_date,
- id_deal, - id_deal,
- business_scope,
- active_accommodations_per_deal_segmentation. - active_accommodations_per_deal_segmentation.
data_tests: data_tests:
@ -3821,6 +3822,7 @@ models:
combination_of_columns: combination_of_columns:
- end_date - end_date
- id_deal - id_deal
- business_scope
- active_accommodations_per_deal_segmentation - active_accommodations_per_deal_segmentation
columns: columns:
@ -3844,6 +3846,19 @@ models:
data_tests: data_tests:
- not_null - not_null
- name: business_scope
data_type: string
description: |
Business scope identifying the metric source.
data_tests:
- not_null
- accepted_values:
values:
- "Old Dash"
- "New Dash"
- "API"
- "UNSET"
- name: active_accommodations_per_deal_segmentation - name: active_accommodations_per_deal_segmentation
data_type: string data_type: string
description: | description: |
@ -3890,6 +3905,7 @@ models:
The unique key corresponds to: The unique key corresponds to:
- end_date, - end_date,
- id_deal, - id_deal,
- business_scope,
- active_accommodations_per_deal_segmentation. - active_accommodations_per_deal_segmentation.
data_tests: data_tests:
@ -3897,6 +3913,7 @@ models:
combination_of_columns: combination_of_columns:
- end_date - end_date
- id_deal - id_deal
- business_scope
- active_accommodations_per_deal_segmentation - active_accommodations_per_deal_segmentation
columns: columns:
@ -3920,6 +3937,19 @@ models:
data_tests: data_tests:
- not_null - not_null
- name: business_scope
data_type: string
description: |
Business scope identifying the metric source.
data_tests:
- not_null
- accepted_values:
values:
- "Old Dash"
- "New Dash"
- "API"
- "UNSET"
- name: active_accommodations_per_deal_segmentation - name: active_accommodations_per_deal_segmentation
data_type: string data_type: string
description: | description: |
@ -3998,6 +4028,7 @@ models:
- global - global
- by_number_of_listings - by_number_of_listings
- by_billing_country - by_billing_country
- by_business_scope
- by_deal - by_deal
- name: dimension_value - name: dimension_value
@ -4060,6 +4091,7 @@ models:
- global - global
- by_number_of_listings - by_number_of_listings
- by_billing_country - by_billing_country
- by_business_scope
- by_deal - by_deal
- name: dimension_value - name: dimension_value
@ -4290,6 +4322,7 @@ models:
The unique key corresponds to: The unique key corresponds to:
- end_date, - end_date,
- id_deal, - id_deal,
- business_scope,
- active_accommodations_per_deal_segmentation. - active_accommodations_per_deal_segmentation.
data_tests: data_tests:
@ -4297,6 +4330,7 @@ models:
combination_of_columns: combination_of_columns:
- end_date - end_date
- id_deal - id_deal
- business_scope
- active_accommodations_per_deal_segmentation - active_accommodations_per_deal_segmentation
columns: columns:
@ -4320,6 +4354,19 @@ models:
data_tests: data_tests:
- not_null - not_null
- name: business_scope
data_type: string
description: |
Business scope identifying the metric source.
data_tests:
- not_null
- accepted_values:
values:
- "Old Dash"
- "New Dash"
- "API"
- "UNSET"
- name: active_accommodations_per_deal_segmentation - name: active_accommodations_per_deal_segmentation
data_type: string data_type: string
description: | description: |
@ -4470,6 +4517,7 @@ models:
The unique key corresponds to: The unique key corresponds to:
- end_date, - end_date,
- id_deal, - id_deal,
- business_scope,
- active_accommodations_per_deal_segmentation. - active_accommodations_per_deal_segmentation.
data_tests: data_tests:
@ -4477,6 +4525,7 @@ models:
combination_of_columns: combination_of_columns:
- end_date - end_date
- id_deal - id_deal
- business_scope
- active_accommodations_per_deal_segmentation - active_accommodations_per_deal_segmentation
columns: columns:
@ -4500,6 +4549,19 @@ models:
data_tests: data_tests:
- not_null - not_null
- name: business_scope
data_type: string
description: |
Business scope identifying the metric source.
data_tests:
- not_null
- accepted_values:
values:
- "Old Dash"
- "New Dash"
- "API"
- "UNSET"
- name: active_accommodations_per_deal_segmentation - name: active_accommodations_per_deal_segmentation
data_type: string data_type: string
description: | description: |
@ -4700,6 +4762,7 @@ models:
- global - global
- by_number_of_listings - by_number_of_listings
- by_billing_country - by_billing_country
- by_business_scope
- by_deal - by_deal
- name: dimension_value - name: dimension_value
@ -4877,6 +4940,7 @@ models:
- global - global
- by_number_of_listings - by_number_of_listings
- by_billing_country - by_billing_country
- by_business_scope
- by_deal - by_deal
- name: dimension_value - name: dimension_value