Merged PR 3451: Adds Deal Daily Lifecycle and metrics

# Description

Changes:
* Creates lifecycle_daily_deal, metric_daily_deals and agg_daily_deals. These follow a different strategy due to the nature of the metrics
* Modifies the dimension macro to ensure deal dimension is included in all models except these ones
* Fixes production issue on currently deployed deal lifecycle and metrics

# 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: #23566
This commit is contained in:
Oriol Roqué Paniagua 2024-11-07 10:49:06 +00:00
parent 9ef9a57c03
commit 8c23f91242
7 changed files with 821 additions and 6 deletions

View file

@ -102,20 +102,27 @@ Provides a general assignemnt for the Dimensions available for each KPI
dim_global(),
dim_number_of_listings(),
dim_billing_country(),
dim_deal(),
] %}
{# Initialize a list to hold any model-specific dimensions #}
{% set additional_dimensions = [] %}
{# Adds Deal dimension to all models except DEAL metrics #}
{% if entity_name != "DEALS" %}
{% set additional_dimensions = additional_dimensions + [dim_deal()] %}
{% endif %}
{# Add entity-specific dimensions #}
{% if entity_name == "CREATED_BOOKINGS" %}
{% set additional_dimensions = [dim_dash()] %}
{% set additional_dimensions = additional_dimensions + [dim_dash()] %}
{% endif %}
{# Add entity-specific dimensions #}
{% if entity_name == "CHECK_IN_ATTRIBUTED_GUEST_JOURNEYS" %}
{% set additional_dimensions = [dim_has_payment(), dim_has_id_check()] %}
{% set additional_dimensions = additional_dimensions + [
dim_has_payment(),
dim_has_id_check(),
] %}
{% endif %}
{# Combine base dimensions with additional dimensions for the specific model #}