Commit graph

1901 commits

Author SHA1 Message Date
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
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
Oriol Roqué Paniagua
0021827368 Merged PR 5429: Rework Booking Source in int_core__bookings
# Description

This PR creates a proper Booking Source in `int_core__bookings` table. This mostly refers to ensure that whenever we do data requests tickets on this regards we have a proper logic in place (as last time we had issues because of this). Logic follows Gus recommendation on applying:

```
case
  when upper(coalesce(bsrc.booking_source, 'UNKNOWN')) = 'UNKNOWN'
  then b.raw_booking_source
  else bsrc.booking_source
end
```

where b. is Booking table and bsrc. is Booking Source table.

Things to note:
* A new `stg_core__booking_source` table is created, full-refreshed from the backend (less than 10 records)
* I added a unique test for `stg_core__booking` that was not in there. I don't document the rest of the model though.
* I remove the previous `id_booking_source` as it wasn't used and the logic in place should be far more accurate.
* I do NOT remove the existing `verification_request_booking_source`. I don't remember what's this but I see this is in use specially on Guest Insights (CSAT) and the legacy Truvi reporting (Bookings, PMS, etc.). Not the scope of this ticket to change it.
* I don't do further propagation, but potentially, this could be extended to New Dash Booking Summary as this source is being shown in the dashboard itself.

# 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: #30415
2025-06-10 14:38:35 +00:00
Pablo Martin
47c51dd18d missing filter to avoid new vrs appearing in the old cte 2025-06-10 16:35:16 +02:00
Pablo Martin
61ceda5234 Merge branch 'master' of ssh.dev.azure.com:v3/guardhog/Data/data-dwh-dbt-project 2025-06-10 15:08:24 +02:00
Pablo Martin
70cf3ce312 missing cast to make union work 2025-06-10 15:08:18 +02:00
Joaquin Ossa
8b415fc726 Merged PR 5427: data alert fix
# Description

Change in model `int_core__accommodation_to_product_bundle` to remove effective dates and use original start and end date.
Updated downstream models as well

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

data alert fix

Related work items: #30948
2025-06-10 12:57:05 +00:00
Joaquin
5f2bd33eed addressed comments 2025-06-10 14:45:53 +02:00
Joaquin
c5c25af59b addressed comments 2025-06-10 14:42:59 +02:00
Joaquin
1bd2fd9585 updated comments 2025-06-10 14:22:40 +02:00
Joaquin
a543fa1d83 changed names 2025-06-10 14:20:28 +02:00
Joaquin
e85de15d22 data alert fix 2025-06-10 13:58:50 +02:00