Commit graph

712 commits

Author SHA1 Message Date
Joaquin Ossa
b6a752fd74 edeposit_users to staging 2024-09-02 11:33:21 +02:00
Joaquin Ossa
46d5e7c3c5 Updating with Ray's comments 2024-09-02 11:16:51 +02:00
Oriol Roqué Paniagua
d8e6ee3ab0 Merged PR 2704: Adding New Dash exposures
# Description

Adds New Dash exposures to close the ticket

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

# Other

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

Adding New Dash exposures

Related work items: #19570
2024-09-02 07:22:29 +00:00
Joaquin Ossa
7a77691b89 deleted schema from edeposit reporting 2024-08-30 10:58:24 +02:00
Joaquin Ossa
fd98f31fdd Kept basic models to reduce complexity of
models/20125_edeposit_migration_agg_model_reporting
2024-08-30 10:54:00 +02:00
Joaquin Ossa
42510bbb4d Just committing to save change and create a new branch for basic to push basic changes 2024-08-30 10:33:43 +02:00
Oriol Roqué Paniagua
7ba65999c3 Merged PR 2687: Materialize int_core__verification_payments as a table
# Description

Just materializes `int_core__verification_payments` as a table instead as a view to enhance compute.

# 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. **Technically I get errors in local but from what I see it's because I have different dumps for the currency conversion and the other sources. There's no such cases in prod from what I observed.**
- [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: #19082
2024-08-29 14:25:18 +00:00
Joaquin Ossa
6adc424963 addressed Pablo's comments, removed the repetitive casts, added some nut_null tests and fixed some of the names and descriptions discrepancies 2024-08-29 14:25:00 +02:00
Joaquin Ossa
ad2eb2544c edeposit_agg_fee_per_user to reporting 2024-08-29 11:09:09 +02:00
Joaquin Ossa
951bc70123 Merged PR 2671: New aggregated model for E-deposit report
# Description

New aggregated model for E-deposit report
@<Oriol Roqué Paniagua> not sure if this is what you had in mind with categorizing the cases in a variable, if not let me know so maybe we can check it together

# 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: #20125
2024-08-29 08:33:45 +00:00
Oriol Roqué Paniagua
2f77c8eea8 Merged PR 2676: Propagates Billing Country information
# Description

Propagates Billing Country information in unified_user and user_host intermediate models. This is a necessary step towards providing KPIs segmented by Billing Country.

# 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: #19082
2024-08-29 08:25:05 +00:00
Joaquin Ossa
189e77dd76 fixed variable definitions and added comments for currency-less fees 2024-08-29 09:30:36 +02:00
Joaquin Ossa
be59ab258a Fixed test 2024-08-28 16:42:10 +02:00
Joaquin Ossa
0b6239e5c2 New aggregated model in intermediate for e-deposit report 2024-08-28 16:38:30 +02:00
Joaquin Ossa
b333b45891 Added some comments to make it clear that ids here are unrelated to core dwh, I will come back to modify the schemas when Ray answers all of our questions related to this data 2024-08-28 15:22:17 +02:00
Joaquin Ossa
167645428e renamed columns 2024-08-28 15:22:17 +02:00
Joaquin Ossa
5892fe7cbb Changed it to basic model 2024-08-28 15:21:08 +02:00
Joaquin Ossa
a4dc798f86 e-deposit model WIP 2024-08-28 15:15:27 +02:00
Joaquin Ossa
a1e3174700 e-deposit verifications data to intermediate 2024-08-28 15:15:27 +02:00
Joaquin Ossa
7786f2e770 1st commit edeposit_verifications 2024-08-28 15:12:05 +02:00
Oriol Roqué Paniagua
2facaceec0 Merged PR 2662: New Dash MVP - with. fix on production issue
# Description

Same PR as before, just adds a new commit that fixes my silly issue in prod. I owe some drinks :D

# 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: #19570
2024-08-28 10:09:08 +00:00
Joaquin Ossa
46a6ff057d fixed testing for core__check_in_cover_listings 2024-08-28 10:47:31 +02:00
Oriol Roqué Paniagua
00b8c66709 Merged PR 2652: Adds accommodation to product bundle in intermediate
# Description

Adds accommodation to product bundle in intermediate. The source table is currently empty, because there's no product bundle different to Basic Screening applied into a listing yet.
Thus, it's possible that this modelisation needs to change in the future since not having data forces us to trust the business logic without a proper technical documentation.

# Checklist

- [ ] The edited models and dependants run properly with production data. **N/A no data**
- [X] The edited models are sufficiently documented.
- [ ] The edited models contain PK tests, and I've ran and passed them. **N/A no data**
- [X] I have checked for DRY opportunities with other models and docs.
- [X] I've picked the right materialization for the affected models. **N/A no data - but view should make the trick for the time being**

# Other

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

Related work items: #19570
2024-08-27 14:05:24 +00:00
Joaquin Ossa
67468a3220 Merged PR 2653: fixed bookings test to include null for verification_request_booking_source
# Description

Fixed bookings test to include null for verification_request_booking_source

# 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: #20231
2024-08-27 13:48:52 +00:00
Joaquin Ossa
87eac12281 fixed bookings test to include null for verification_request_booking_source 2024-08-27 15:45:22 +02:00
Oriol Roqué Paniagua
b927635cf1 Merged PR 2650: Added int_core__booking_to_product_bundle in intermediate
# Description

Creates a new view with the bookings that come from New Dash, linked to the Product Bundles. Extensive documentation added, please check it out and if something is not clear I'll modify 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.
- [X] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models. To be discussed. There's not huge data still so view looks ok to me. I guess, maybe, in the future, we will have a flag or similar in int_core__bookings to detect if a bookings comes from New Dash/New Pricing or not, but it's still early to decide. In any case this model is needed for immediate New Dash MVP reporting so I propose to keep it like this as a view and afterwards we can decide if it makes more sense to materialise it differently.

# Other

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

Related work items: #19570
2024-08-27 12:51:55 +00:00
Oriol Roqué Paniagua
c613d2859f Merged PR 2648: Fixes int_dates_by_deal tests
# Description

Fixes int_dates_by_deal tests

# 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: #20318, #20319
2024-08-27 09:34:07 +00:00
Pablo Martín
3c73bcf965 Merged PR 2646: Add missing edeposit columns
# Description

Adds three more columns to the staging model of `verifications` for edeposit: `ListingId`, `NightlyFee` and `CompanyName`.

# Checklist

- [X] The edited models and dependants run properly with production data.
- ~~[ ] The edited models are sufficiently documented.~~ __No, but I promise they will be.__
- [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: #20123
2024-08-27 09:22:52 +00:00
Oriol Roqué Paniagua
cb3d1e628b Merged PR 2647: Adding accommodation_to_product_bundle to stg
# Description

Adds accommodation to product bundle table from sync_core to staging. Note that this table still has no data because so far no listing has an associated product bundle.

Small change: removed in schema pending confirmation comments from Lou now that we've got an answer confirming it.

# Checklist

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

# Other

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

Related work items: #19570
2024-08-27 08:57:23 +00:00
Pablo Martin
4cc456c3b0 add missing columns to model 2024-08-27 10:33:18 +02:00
Oriol Roqué Paniagua
3d9c7cf571 Merged PR 2636: First version of User Product Bundle
# Description

Working version of User Product Bundle in intermediate. I tried to be quite explicit in the documentation of the model and the choices made (both in the code itself and in the schema). There's some opinionated choices so feel free to challenge them.

There's a small change on the user_migration model, in which I didn't properly set a field into a date.

Note that there's some schema comments pending from Lou's validation. Up to you if we prefer to wait until resolved or we move forward - to me, it's not blocking.

# 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: #19570
2024-08-26 09:18:56 +00:00
Pablo Martin
c0f4a59aeb add version field to staging table 2024-08-26 09:30:10 +02:00
Pablo Martín
a24c2efb5a Merged PR 2631: Accounting Report Exposures
# Description

Creates exposure entries for the accounting reports that are already in production (Invoicing and Crediting and Resolutions Host Payments).

# Checklist

- __NA__ ~~[ ] The edited models and dependants run properly with production data.~~
- [X] The edited models are sufficiently documented.
- __NA__ ~~[ ] 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: #17550
2024-08-22 12:23:14 +00:00
Oriol Roqué Paniagua
c8f4d2be70 Merged PR 2629: Integrates logic to detect New Dashboard users within DWH
# Description

First step towards reporting New Dash is to be able within DWH to know which hosts have been migrated.
In order to do so, and anticipating that there's going to be new phases in the future, I've created a `int_core__user_migration` model that reads from a configuration macro `get_new_dash_migration_phases_config` that will allow semi-automatic user retrieval in the future. This avoids nasty hardcoding within the model itself.
The information of whether a user is migrated, in which phase and when the phase was deployed is available at user level in the `int_core__user_host` table.

# 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. **-> I selected a view for this model since I don't believe we should materialse this data other than the user host table**

# Other

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

Related work items: #19570
2024-08-22 12:10:25 +00:00
Pablo Martín
78838cb7f6 Merged PR 2619: edeposit verifications container to staging
# Description

This PR turns the JSON documents of the verification container in sync into a table in staging. It also performs the necessary deduplication of records by ID and timestamp along the way.

I'm intentionally skipping proper documentation to unblock a colleague while I fetch the necessary knowledge to populate the schema docs properly. I pinky promise I won't forget and I'll come back and fix it.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [ ] ~~The edited models are sufficiently documented.~~ __Nope, read above.__
- [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: #20123
2024-08-21 15:59:39 +00:00
Pablo Martin
4214c6b1c5 schema, small fixes on model 2024-08-21 17:48:06 +02:00
Oriol Roqué Paniagua
85131985d8 Merged PR 2615: Beautification of KPIs dimensions
# Description

Changes:

* Separate 1) the internal naming of dimensions available within DWH vs. 2) the display of the dimensions in the reporting. Mainly it changes the "by_number_of_listings" to display "By # of Listings Booked in 12 Months". I edited the production macro since to me it's linked to when things are available for display.
* Add preceding zeros on the segmentation so it's ordered correctly. Before, the segment 21-60 was displayed before the 6-20.
* Also added some capital letters to the schema config of the reporting model :)

I attach a screenshot of how it looks in PBI in my local development branch to exemplify why this is "Beautification". Be aware that merging this also puts in production the dimensions.

![image.png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/2615/attachments/image.png)

# 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: #19325
2024-08-21 14:42:05 +00:00
Pablo Martin
40168f74b3 reorder fields 2024-08-21 15:13:19 +02:00
Pablo Martin
34a2279387 some casts 2024-08-21 15:12:05 +02:00
Pablo Martin
64e5d78578 progress in staging, ordered fields 2024-08-21 12:56:45 +02:00
Pablo Martin
2331db2803 add source file 2024-08-21 12:46:05 +02:00
Oriol Roqué Paniagua
83d913f9fc Merged PR 2607: Propagates and exposes multiple dimension handling for KPIs
# Description

This PR ensures the propagation of the dimensions for KPIs across the key aggregating and exposing models. Additionally, provides these 2 new fields in reporting while **not affecting the current data display**, thus it's safe to work in the PBI report without needing to work in 2 PRs in parallel.

**Changes:**

**1 - Intermediate, `int_mtd_vs_previous_year_metrics`:**

* Removes the temporary filter on `where dimension in ({{ production_dimensions }})`. This will be applied directly to reporting later. This ensures that the new dimension on customer segmentation is fully available only within intermediate.
* Adds `dimension` and `dimension_value` granularity. This includes: 1) adding these fields, 2) joining by these fields with all the source CTEs containing the source models with metrics - which in turn needs the change of the dates model - and 3) joining by these fields in the self-join to compute the incremental vs. previous year.
* Changes on the schema file

**2 - Intermediate, `int_mtd_aggregated_metrics`:**

* Adds `dimension` and `dimension_value` granularity. This includes only adding these fields.
* Changes on the schema file

**3 - Reporting, `mtd_aggregated_metrics`:**

* Adds the filter removed on `int_mtd_vs_previous_year_metrics`. This ensures that only the Global dimension is available for the reporting, thus **no changes from user POV**.
* Adds `dimension` and `dimension_value` granularity. This includes only adding these fields
* Changes on the schema file

# 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: #19325
2024-08-20 15:42:27 +00:00
Joaquin Ossa
bf9652f258 Finished adding address_validation to reporting 2024-08-20 14:11:21 +02:00
Joaquin Ossa
db9f9a6c25 Merged PR 2599: Added address_validation to int_core__vr_check_in_cover
# Description

Added address_validation to int_core__vr_check_in_cover for check in hero report in PBI

# 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: #17069
2024-08-20 12:06:51 +00:00
Oriol Roqué Paniagua
80abac494a Merged PR 2583: Invoicing metrics per customer segmentation
# Description

Silly change:

* Modifies `int_core__mtd_guest_payments_metrics` to apply the proper key on date, dimension and dimension_value.
* -> *The weird thing is that the previous dbt test I run worked well. Is it possible that the configuration in the schema file prevails on top of the model configuration? I thought it was the other way around...*

Main changes:

* Modifies `int_xero__mtd_invoicing_metrics` to include the customer segmentation based on listings.
* `schema.yaml` is also affected including new fields and tests
* Added the macro to retrieve the production dimension in `int_core__mtd_vs_previous_year_metrics` to avoid propagating this upwards and messing up with the data display.

Overall, follows a similar strategy as we did for Booking, Guest Journey, Deal, Accommodation and Guest Payments metrics. For reference, [here's the previous PR on Guest Payments](https://guardhog.visualstudio.com/Data/_git/data-dwh-dbt-project/pullrequest/2580).

This is the last PR on the source models for KPIs. Will follow: propagation + exposure

# Checklist

- [X] The edited models and dependants run properly with production data.
* **Important note**: this segmentation provides null values for all API-related KPIs. Makes sense, since the 4 deal id we have for APIs do NOT have, or have had, a listing linked to them. I'd say it's not a blocker.
- [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: #19325
2024-08-20 12:05:53 +00:00
Oriol Roqué Paniagua
68f490f9fa Merged PR 2593: Modifying int_core__user_host to take into account KYG users
# Description

Adds the possibility of considering as Hosts those users that come from Know Your Guest (KYG), after the discussion with Ben R yesterday. This uses the Claim table, specifically on any Kyg claim type:
- KygRegistrationSignUpType
- KygRegistrationIntegrationTypeName
- KygMvp

From what I see compiling the new vs. the previous version of this model and running into production to have up-to-date data, this increases the number of hosts in 8, from 2.608 to 2.616 so it's not a massive change in volumes.

I also modified the schema for this model to reflect the new logic.

# 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: #19513
2024-08-20 11:27:43 +00:00
Joaquin Ossa
45f7f640ba Changed names for easier understanding 2024-08-20 12:56:52 +02:00
Joaquin Ossa
c9fb99743a Merge remote-tracking branch 'origin/models/17069_addressvalidation_to_reporting' into models/17069_addressvalidation_to_reporting 2024-08-20 12:32:58 +02:00
Joaquin Ossa
8171fda345 Merged PR 2578: Created address_validations in intermediate
# Description

Created address_validations in intermediate for check in hero

# 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: #17069
2024-08-20 09:46:27 +00:00
Joaquin Ossa
1c60099b0b Removed coalesce so it includes NULL for failed validations 2024-08-20 10:02:04 +02:00