Commit graph

1911 commits

Author SHA1 Message Date
Pablo Martin
7488400cbb fix bugs in orphan model detection 2025-07-08 17:05:45 +02:00
Pablo Martin
717590513f Merged PR 5617: Orphan Models Script
# Description

This PR adds a script to look for orphan models in the DWH. The `README.md` has been expanded to explain how to use and schedule this script.
2025-07-08 12:45:30 +00:00
Oriol Roqué Paniagua
a1429ccec8 Merged PR 5634: Adapt Revenue Churn Rate Targets from 3% to 1%
# Description

Adapt Revenue Churn Rate Targets from 3% to 1%, also affecting Revenue Churn (to 1/3rd).

This should put our targets aligned with those on Finance side.

# 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.
- [ ] 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.

Related work items: #31351
2025-07-07 12:54:39 +00:00
Oriol Roqué Paniagua
900c73b076 Merged PR 5632: Resolution incidents in status Incomplete now have reduced test coverage
# Description

Resolution incidents in status Incomplete now have reduced test coverage.

This fixes today's data alert.

# 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.
- [ ] 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.

Related work items: #31843
2025-07-07 12:53:52 +00:00
Pablo Martin
ad67a79a24 script and docs 2025-07-04 12:25:21 +02:00
Joaquin Ossa
e0e97709c0 Merged PR 5607: stay confident inclusion
# Description

Removed tests in intermediate model and added StayDisrupt as an accepted value for `product_name`

# 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.
- [ ] 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.

stay confident inclusion

Related work items: #31721
2025-07-02 13:42:45 +00:00
Joaquin
b9fe9a0552 stay confident inclusion 2025-07-02 14:37:44 +02:00
Oriol Roqué Paniagua
8bc525e4c2 Merged PR 5589: Limits data test coverage on resolutions data
# Description

This relates to the data alerts on resolutions models.

We have one incident status that refers to the record having missing information. The record that is currently triggering this alerts is indeed tagged as such.

The idea is to:
* Create a new boolean that flags if the incident has missing information. This is propagated stg to reporting.
* Apply a where clause to any existing data alert that might be susceptible to fail due to not having enough quality, in staging and reporting.
* Remove over coverage in intermediate since it's already happening in reporting. However we keep a few not-null tests and the PK on critical information (i.e., id_booking).

# 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.
- [NA] I have checked for DRY opportunities with other models and docs.
- [NA] 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: #31668
2025-07-01 09:44:54 +00:00
Joaquin Ossa
ca939e0c69 Merged PR 5573: Duplicated payments temporal fix
# Description

Temporary fix for duplicated payments, this affects 2 models.
They use to be incremental but since they are small this was changed and added the filter to exclude the duplicated records.
I left the deprecation date as 31/07/2025

# 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.
- [ ] 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.

duplicated payments temporal fix

Related work items: #31324
2025-07-01 08:46:59 +00:00
Oriol Roqué Paniagua
412e242f42 Merged PR 5586: Fix duplications on 1st of Month for Billable Items Growth Score
# Description

This relates to today's data alerts on Growth Score models.

Error has been found in `int_billable_items_growth_score_by_deal`. This only happens on the 1st of the month.

On the 1st day of the month we will have:
* The actual monthly data from KPIs in the previous month.

But also:
* Projected KPIs will still display data for the previous month, in this case though, projected = actuals.

There's a union all that combines actual monthly KPI data for history purposes and the projected data which fails in this case.

Fix is to remove the data from Projected KPIs if the current date of execution (1st of July) equals the first day of the month when computing `end_date` + 1 day. End date being at this moment 30th of June, + 1 day = 1st of July, extracting the first day of the month then 1st July.

# 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.
- [NA] I have checked for DRY opportunities with other models and docs.
- [NA] 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: #31665
2025-07-01 08:38:21 +00:00
Joaquin Ossa
7bf9168796 Merged PR 5582: Update exposures gj ab test
# Description

Update exposures to include Guest Journey A/B test notebook
Created a new A/B test monitoring model in reporting.
Removed tests of the intermediate model so we don't have duplicated tests since it is basically the same model in reporting

# 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.
- [ ] 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.

Update exposures gj ab test

Related work items: #31448
2025-07-01 08:19:53 +00:00
Joaquin
9630001f01 new a/b test model in reporting and updated exposure 2025-07-01 09:59:36 +02:00
Joaquin
7330848ed0 Update exposures gj ab test 2025-07-01 09:27:02 +02:00
Joaquin
4cda82fe48 duplicated payments temporal fix 2025-06-30 14:25:39 +02:00
Pablo Martin
61c1509337 add sqlfluff to deps 2025-06-27 11:21:18 +02:00
Pablo Martin
f11945519e Merged PR 5551: Prettify alerts in test script
# Description

This PR modifies the test script messaging towards slack. Until now, when tests failed, we simply sent a general message to slack saying something failed. With this PR, we will send one message per test, detailing the table and test, number of bad records, and the compiled test's SQL query that can help us debug.

On testing success, the output will still be a simple success message.

# Checklist

NA

# Other

NA

Related work items: #31476
2025-06-26 13:23:17 +00:00
Pablo Martin
71a1bd6da6 modify test script 2025-06-26 14:58:08 +02:00
Joaquin Ossa
8b1c32367d Merged PR 5538: Fixed tests from resolutions
# Description

Removed tests for non mandatory fields

# 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.
- [ ] 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.

Fixed tests from resolutions

Related work items: #31122
2025-06-25 08:41:57 +00:00
Joaquin
52e351e0ba Fixed tests from resolutions 2025-06-20 10:39:21 +02:00
Joaquin Ossa
6924d927c3 Merged PR 5508: Finished reporting tests
# Description

Finished reporting tests for lifecycle

# 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.
- [ ] 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.

Finished reporting tests

Related work items: #31340
2025-06-19 12:51:45 +00:00
Joaquin Ossa
f567b233aa Merged PR 5507: finished updating tests in reporting model
# Description

Finished updating tests in reporting model

# 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.
- [ ] 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.

finished updating tests in reporting model

Related work items: #31122
2025-06-19 12:51:26 +00:00
Joaquin
d0464bfd1c Finished reporting tests 2025-06-19 14:47:13 +02:00
Joaquin
df267d605e finished updating tests in reporting model 2025-06-19 14:39:57 +02:00
Joaquin Ossa
5005b72323 Merged PR 5506: Removed not_null tests
# Description

Removed not_null tests for not mandatory fields, guest, host and listing data.
Manual forms are being excluded from the models because of the unreliability of the data

# 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.
- [ ] 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.

Removed not_null tests

Related work items: #31122
2025-06-19 10:12:16 +00:00
Joaquin Ossa
a279e78fa2 Merged PR 5505: Remove new deals without lifecycle
# Description

Small change to remove new deals without lifecycle state due to joining Truvi late yesterday but showing in Hubspot with effective date early today

# 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.
- [ ] 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.

Related work items: #31340
2025-06-19 10:12:08 +00:00
Joaquin
76f243a486 Removed not_null tests 2025-06-19 11:58:37 +02:00
Joaquin
147197c92d Modified test 2025-06-19 11:35:52 +02:00
Joaquin
ecf38144cb fixed schema 2025-06-19 09:09:56 +02:00
Joaquin
986c9f85a8 exclude deals without lifecycle 2025-06-19 09:04:48 +02:00
Oriol Roqué Paniagua
a8927b7a44 Merged PR 5463: New Dash user categorisation + revamp model
# Description

Fixes:
* There was a data quality issue in which active listings with bundles were showing more listings than the total active listings. This has been fixed, plus a bunch of tests have been added to make sure this does not happen again.
* There's a field that reaches the 63 character limit. I modified "paid" per "upgraded" which reduces this to intermediate model; however in reporting I need to keep as is to avoid breaking PBI. I did change the name of the field in the schema so tests/docs work well and explicitly mention this in the doc. This will need adaptation but can be done in the future.
* There was tons of dead code tagged as to be deleted that was not deleted, not sure why or when. Anyway this is dropped now. It's not used in PBI except for the fact that columns are dropped in the data model, so we might have a bit of down time to just remove these.
* Few fields were not displayed correctly in dbt docs.

What's new:
* New user categorisation as an alert-based system. This can be enhanced in the future but so far it covers hell of a lot of cases. This also includes data quality alerts (deal not in HS, or account defaults to MVP launch).
* MVP Launch date moved to project yaml since it's a very standard date.

# 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: #30407
2025-06-13 14:05:30 +00:00
Pablo Martin
11bdc7d4b3 stay disrupt exposure 2025-06-13 09:38:30 +02:00
Pablo Martin
2c5ad8c228 updated CIH exposures 2025-06-13 09:19:40 +02:00
Pablo Martin
efe3f50a37 relax test that didn't make sense, revert wrong solution to issue from this morning 2025-06-12 17:56:24 +02:00
Pablo Martin
2a5c82f62b Merged PR 5455: Bump dbt version to 1.9.8
# Description

This PR changes the `requirements.txt` to allow any patch equal or higher than 1.9.8, but below 1.10.0.

Related work items: #30881
2025-06-12 14:27:45 +00:00
Pablo Martin
9d100192c0 bump dbt version 2025-06-12 16:13:53 +02:00
Joaquin Ossa
20ce96cd29 Merged PR 5449: silly me
# Description

Missed the change of sign for `due_amount_in_local_currency`

# 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.

silly me

Related work items: #30204
2025-06-12 10:16:47 +00:00
Joaquin
ae373a4fc9 silly me 2025-06-12 12:07:16 +02:00
Pablo Martin
20477dcc2c Merged PR 5447: Fix GJ Payments consistency with VRs
# Description

We're getting Data Alerts triggered for Guest Journey payments with no id for the guest. This is because we have payments in the DWH for which we still don't have the related Verification Request in the DWH as well.

This PR changes a `LEFT JOIN` with the verification request table into an `INNER JOIN`, effectively making it impossible for a payment to not have user data if the VR is not there.

We increase data latency (the payment won't show up until the related VR is in the DWH) but we win consistency (no orphan payments without their full details).

# 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.

change left join to inner join
2025-06-12 08:06:08 +00:00
Joaquin Ossa
5abbff9560 Merged PR 5441: New fields for Invoicing & Crediting
# Description

New fields for Invoicing & Crediting that Finance needs for their usage.
Specifically they need to be able to differentiate the amount due because of invoice and not credit notes to know who to pay resolutions claims or not.
Will also add the amounts in local currency.

# 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.
- [ ] 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.

New fields for Invoicing & Crediting

Related work items: #30204
2025-06-12 07:23:11 +00:00
Joaquin
6c7e80eb75 Addressed comments 2025-06-12 09:22:22 +02:00
Joaquin Ossa
9c4b12e985 Merged PR 5438: Add Flex API into KPI models
# Description

Including Flex API revenue into KPI models.
Will also update the Main KPIs report

# 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.
- [ ] 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.

Add Flex API into KPI models

Related work items: #31041
2025-06-11 15:01:22 +00:00
Joaquin Ossa
fcff46144f Merged PR 5431: Update accounting aggregation
# Description

Update accounting aggregation seed with the latest changes including the division of waiver payments, confident stay and some new updates from finance.

In the meantime I'll do a full refresh run, that will take quite a while, to check that I am not breaking anything

# 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.
- [ ] 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.

Update accounting aggregation

Related work items: #30995
2025-06-11 15:01:17 +00:00
Joaquin
80651ce60e New fields for Invoicing & Crediting 2025-06-11 16:57:10 +02:00
Joaquin
940d8b3bcf Updated test 2025-06-11 15:26:44 +02:00
Joaquin Ossa
84e8100706 Merged PR 5439: Removed test
# Description

Remove test `not_null` from `stg_resolutions__incidents` since it is not actually mandatory for the booking to include the guest email information

# 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.
- [ ] 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.

Removed test

Related work items: #31043
2025-06-11 13:09:30 +00:00
Joaquin
f482b64528 Removed test 2025-06-11 14:51:20 +02:00
Joaquin
4a4e17f068 Add Flex API into KPI models 2025-06-11 14:44:07 +02:00
Joaquin
3e3b7f049e Removed changes 2025-06-11 14:34:44 +02:00
Joaquin
55699a1647 Addressed comments and all KPI model changes 2025-06-11 12:25:14 +02:00
Joaquin
44b59aafd2 Update accounting aggregation 2025-06-11 09:09:57 +02:00