Commit graph

556 commits

Author SHA1 Message Date
Joaquin Ossa
0cebdcf160 new approach for S&P users data extraction 2024-12-18 11:46:54 +01:00
Joaquin Ossa
24aa9b7021 Helped with readability on test 2024-12-18 10:52:52 +01:00
Joaquin Ossa
c95f551acf s&p update models 2024-12-17 19:09:54 +01:00
Oriol Roqué Paniagua
384665c487 Merged PR 3857: Propagate Amount of Properties in HS deal
# Description

Adds the field amount_of_properties to hubspot deals, in intermediate

# 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: #25351
2024-12-17 09:02:11 +00:00
Joaquin Ossa
3653ad8adf fixed number of nights in edeposit 2024-12-16 13:53:57 +01:00
Joaquin Ossa
4569c5d0da Added the has_user_moved_from_old_dash field 2024-12-13 10:56:56 +01:00
Joaquin Ossa
dbbfe2eb44 Changed description 2024-12-12 11:29:11 +01:00
Joaquin Ossa
e18750d720 Added nbr og nights to avoid calculation in PBI 2024-12-12 11:27:48 +01:00
Joaquin Ossa
85a02f8a1e Merged PR 3826: Check in Hero models
# Description

Check in Hero models for new report, it contains all records of check in hero API with user partner info

# 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.
- [ ] I've picked the right materialization for the affected models.

# Other

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

Check in Hero models

Related work items: #25403
2024-12-11 16:23:12 +00:00
Joaquin Ossa
34a5b0d86e Adding missing field in S&P models 2024-12-11 16:35:40 +01:00
Joaquin Ossa
11eecfec99 addressed comments 2024-12-11 16:13:34 +01:00
Joaquin Ossa
a564afea3c wip 2024-12-11 15:42:35 +01:00
Joaquin Ossa
cbb93982d0 Check in Hero models 2024-12-11 14:32:39 +01:00
Oriol Roqué Paniagua
c0e6ec2de8 Merged PR 3825: Removing Booking fields soon to be dropped
# Description

Following a communication from Gus, the following fields in Booking table are going to be removed:
* StagingHostBookingId
* AdditionalGuests

This PR aims to remove DWH dependencies.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [NA] 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

- [X] Check if a full-refresh is required after this PR is merged. **Yes, Booking table in staging is incremental**

Related work items: #25405
2024-12-11 13:06:28 +00:00
Oriol Roqué Paniagua
06603d01e2 Merged PR 3810: Adds is_end_of_month_or_yesterday for Main KPIs
# Description

Adds `is_end_of_month_or_yesterday` for Main KPIs.
Apparently, the fact that we do not show the ongoing value of the month on some tabs of Main KPIs is the main blocker for Ben C to consistently use Main KPIs, which he actually retrieves from the SH legacy reporting. Since I'm sceptical about the data shown there, I want to remove this blocker.
It will require a small PR on PBI 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.
- [X] 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: #25342
2024-12-09 16:13:52 +00:00
Joaquin Ossa
1f683ec651 Final clarifications 2024-12-04 16:33:50 +01:00
Joaquin Ossa
2a19f1d19a Added ProtectionType 2024-12-04 14:36:49 +01:00
Joaquin Ossa
c8ee8bd456 intermediate and reporting models 2024-12-04 11:15:21 +01:00
Oriol Roqué Paniagua
616b949ba4 Merged PR 3769: Adds int_core__ab_test_monitoring_guest_journey
# Description

Adds a table that contain the main information needed for metric computation at verification request level that is part of an A/B test.

# 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.
- [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: #25146
2024-12-04 09:45:09 +00:00
Oriol Roqué Paniagua
37c508fa69 Merged PR 3766: First version of ab_test_tracking_guest_journey
# Description

A very simple, clean table to get the records needed for A/B test tracking on GJ side.

The table already removes weird cases that are somehow usual within A/B test configurations, to ensure that the monitoring is as clean (and less biased) as possible.

# 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: #25145
2024-12-04 07:58:14 +00:00
Oriol Roqué Paniagua
896526fe15 Merged PR 3761: Remove no longer existing fields from Accommodation
# Description

This PR aims to properly fix the Accommodation removal of fields that have been dropped today.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [NA] 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: #25199
2024-12-03 16:39:05 +00:00
Joaquin Ossa
1af03e2b42 included id_accommodation 2024-12-03 11:58:42 +01:00
Joaquin Ossa
63b3cae062 Removed null fields 2024-12-03 11:35:03 +01:00
Joaquin Ossa
4d0c45e49d updated schemas 2024-12-03 10:46:01 +01:00
Joaquin Ossa
5e17ca93a7 Included level of protection 2024-12-03 10:42:03 +01:00
Joaquin Ossa
d6f30a8e67 Added missing values 2024-12-03 10:37:05 +01:00
Joaquin Ossa
4c7820608a Merged PR 3698: added service_business_type to new_dash_created_services models
# Description

Added service_business_type to new_dash_created_services models.
Points to check on the chargeable_services models:
- I think it also needs to account for `UNKNOWN` values
- Adding the service_business_type to the unique test on the weekly and monthly metric models

```
case
    when icbsd.service_business_type = 'UNKNOWN'
    then 'UNSET'
    else coalesce(icbsd.service_business_type, 'UNSET')
end as service_business_type
```
@<Oriol Roqué Paniagua> Let me know what you think and I can make the changes if needed

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

added service_business_type to new_dash_created_services models

Related work items: #24767
2024-12-02 11:53:48 +00:00
Joaquin Ossa
7e8e403dec Updated all PK in created and chargeable services models 2024-12-02 12:42:47 +01:00
Joaquin Ossa
3015c12e18 updated schema 2024-12-02 11:14:34 +01:00
Joaquin Ossa
62893d77fc fixing the rebase 2024-12-02 11:07:34 +01:00
Joaquin Ossa
54df02cac8 Addressed comments 2024-12-02 11:06:09 +01:00
Joaquin Ossa
b03982b708 Added total fee cost of booking 2024-12-02 08:44:24 +01:00
Joaquin Ossa
edbeac253c Name change 2024-11-29 11:03:59 +01:00
Joaquin Ossa
c6a03d531a Cleaned commit 2024-11-29 10:06:15 +01:00
Joaquin Ossa
4e6690c013 API verifications model 2024-11-29 09:59:35 +01:00
Joaquin Ossa
07038e8c18 added service_business_type to new_dash_created_services models 2024-11-28 16:12:02 +01:00
Pablo Martin
ff2079a0c6 remove fields from docs 2024-11-27 14:47:43 +01:00
Pablo Martin
878e2e81b6 remove fields from int 2024-11-27 14:46:03 +01:00
Joaquin Ossa
80f42d5426 Modified mtd filter 2024-11-27 09:52:05 +01:00
Joaquin Ossa
8c52049f86 Changed filters 2024-11-27 09:47:30 +01:00
Oriol Roqué Paniagua
db2d626ae0 Merged PR 3676: Hotfix - Chargeable Services - Daily Agg
# Description

I missed applying the Chargeable Services in Daily Agg. This fixes it.

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

Hotfix

Related work items: #20809
2024-11-26 16:52:48 +00:00
Pablo Martín
96f061e122 Merged PR 3671: Refactor new dash user overview
# Description

This query refactors the model `int_core__new_dash_user_overview` to optimize performance.

The output of the model remains unaltered.

The performance gains are obtained by preventing a monster-grade intermediate join with almost 100 million rows + a sequential order that the current `master` model causes. This refactor breaks down the query that caused that into multiple CTEs that pre-aggregate results, avoiding the dimensional explosion.

# 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
2024-11-26 16:03:22 +00:00
Joaquin Ossa
dd4dff1479 Merged PR 3666: Aggregated model for guest kpis metrics in intermediate
# Description

Aggregated model for guest kpis metrics.
This model aggregates the values for all basic metrics for guest kpis, it has a granularity per metrics of timeframe (YTD, MTD, WTD) and all other dimensions needed (has_payment, has_id_check & main_billing_country_iso_3_per_deal).
I decided not to include the calculated metrics because it adds much more complexity to the model specially when you start considering all possible combinations between dimensions and how this would affect the calculations, in this case conversion_rate, revenue_rate and average_csat_score. I think this could all be managed much simpler inside PBI and since the granularity of the model is not as deep as the daily model, this should help with the loading time for the 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.

Related work items: #24604
2024-11-26 15:37:06 +00:00
Pablo Martin
511bef5c9f refactor 2024-11-26 16:05:55 +01:00
Joaquin Ossa
c77defab28 modified py_week_current_date calculation 2024-11-26 15:29:14 +01:00
Oriol Roqué Paniagua
42d70f72d5 Merged PR 3667: Creates Chargeable metrics for New Dash KPIs
# Description

Creates the models for KPIs for New Dash - Chargeable metrics. In essence, computes 4 metrics:
- Chargeable Services
- Chargeable Amount (in GBP)
- Chargeable Bookings (unique over a time period and dimension, not additive)
- Chargeable Listings (unique over a time period and dimension, not additive)

This is done by creating:
- A Weekly Metric and Monthly Metric model. Here we keep the granularity of id_booking / id_accommodation to be able to compute the uniqueness.
- A Daily, Weekly and Monthly Aggregated models. Same as usual.
- Integrates everything to the existing model for Product New Dash Agg Metrics
- Exposes everything into reporting

NB: I removed on "by_host" in Created Services - I forgot to clear it out.

# 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: #20809
2024-11-26 14:19:41 +00:00
Joaquin Ossa
2b89af2bd9 modified abreviations 2024-11-26 14:16:53 +01:00
Joaquin Ossa
07ffb14e9c Aggregated model for guest kpi metrics 2024-11-26 14:05:03 +01:00
Joaquin Ossa
68644630d4 rebase and updated schema 2024-11-26 12:36:54 +01:00
Joaquin Ossa
6b5b7d2d5a fixed model copy paste 2024-11-26 12:36:54 +01:00