data-dwh-dbt-project/tests
Oriol Roqué Paniagua 3ba65e8ed5 Merged PR 3041: Adapts outlier detection
# Description

This PR adapts the outlier detection test for KPIs. Specifically:

1) It removes not additive lifecycle metrics, which are:
- Churning Listings/Deals
- Listings/Deals Booked in Month/6 Months/12 Months

this is because the test computes data at daily level by just doing value/number of days. The thing is that for all these metrics, Listing/Deal bookings are computed **uniquely over a month**, i.e., if a listing is booked 100 times in a single month, it will only appear as once. Thus it makes it fail on early days of the month. Similar case for Churn, in this case, at the beginning of the month we have the total maximum number of listing/deals that are expected to churn if nothing happens, and this can decrease a bit over time if these get reactivated.

2) I reduced the variance threshold from 10 to 8, meaning now the alerts will raise more often. This is because we're removing some wrongly assessed metrics from the computation, thus I feel we can leave with better fine-grained detection. It could be even further reduced (8 is still super high tolerance) since today maximum signal-to-noise ratio was less than 4 on checkout bookings, but I'd propose to see how it goes in the following days and then assess if it's necessary to reduce it even further.

# Checklist

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

# Other

- [ ] Check if a full-refresh is required after this PR is merged.
2024-10-03 10:43:15 +00:00
..
.gitkeep start project 2024-01-18 11:24:35 +01:00
kpis_additive_metrics_per_dimension_are_consistent.sql Merged PR 2752: Adding specific business tests for kpis 2024-09-05 14:01:58 +00:00
kpis_global_metrics_outlier_detection.sql Merged PR 3041: Adapts outlier detection 2024-10-03 10:43:15 +00:00