Merged PR 2660: Revert 'Automating new dash query'

# Description

_Describe your motivation and changes here._

# Checklist

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

# Description

Automates the new dash query through DWH. It's a first step towards enabling a very simple PBI reporting on new dash performance. Data is aggregated at user level with the main performance indicators that we're currently reporting. I added a few more informative fields from user side.

Changes:

* in intermediate, creation of `int_core__new_dash_user_overview`. It mainly uses the models in previous PRs to avoid crazy computations, since most of the logic has already been implemented. The only thing is that it's "hardcoded" (with variable) the categorisation of what is NOT a paid service.
* in reporting, creation of `core__new_dash_user_overview`. It just exposes the info from intermediate to reporting.
* added schema entries for intermediate/core and reporting/core, it's the same description for both cases.

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

Reverts !2657

Related work items: #19570
This commit is contained in:
Oriol Roqué Paniagua 2024-08-28 09:40:09 +00:00
parent 8f38e94a5c
commit a0b5b0bda1
4 changed files with 2 additions and 392 deletions

View file

@ -1,29 +0,0 @@
with
int_core__new_dash_user_overview as (
select * from {{ ref("int_core__new_dash_user_overview") }}
)
select
id_user_host as id_user_host,
user_migration_phase as user_migration_phase,
user_estimated_migration_date_utc as user_estimated_migration_date_utc,
company_name as company_name,
first_name as first_name,
last_name as last_name,
account_currency as account_currency,
total_user_product_bundles as total_user_product_bundles,
active_user_product_bundles as active_user_product_bundles,
total_listings as total_listings,
total_active_listings as total_active_listings,
total_listings_with_product_bundle_with_paid_service
as total_listings_with_product_bundle_with_paid_service,
has_active_listings as has_active_listings,
has_listings_with_paid_service_applied as has_listings_with_paid_service_applied,
has_listings_with_active_paid_service_applied
as has_listings_with_active_paid_service_applied,
total_bookings_with_product_bundle as total_bookings_with_product_bundle,
total_bookings_with_product_bundle_with_paid_service
as total_bookings_with_product_bundle_with_paid_service,
has_bookings_with_product_bundle as has_bookings_with_product_bundle,
has_bookings_with_product_bundle_with_paid_service
as has_bookings_with_product_bundle_with_paid_service
from int_core__new_dash_user_overview

View file

@ -1073,130 +1073,4 @@ models:
The date in which the booking should be invoiced.
This could be the check-in date of the booking or the date in which the guest verification
started, depending on the billing settings of the host.
- name: core__new_dash_user_overview
description: |
This model allows for minimum tracking of how the new dash initative is
performing in the different migrations.
It's a user-centric model in which, for each user, we retrieve some
basic performance indicators in the form of listings and bookings.
columns:
- name: id_user_host
data_type: string
description: |
The unique identifier of this table. It corresponds to the host users
that have been migrated to the New Dashboard.
tests:
- not_null
- unique
- name: user_migration_phase
data_type: string
description: |
The migration phase in which this user was migrated, for informative
purposes.
tests:
- not_null
- name: user_estimated_migration_date_utc
data_type: date
description: |
The estimated date in which this user was migrated.
tests:
- not_null
- name: company_name
data_type: string
description: |
Information about the host user.
- name: first_name
data_type: string
description: |
Information about the host user.
- name: last_name
data_type: string
description: |
Information about the host user.
- name: account_currency
data_type: string
description: |
Currency associated to the host user.
- name: total_user_product_bundles
data_type: integer
description: |
Count of product bundles that this user has or has had.
It contains both active and historic cases.
- name: total_active_user_product_bundles
data_type: integer
description: |
Count of product bundles that this user currently has.
It contains only currently active cases.
- name: total_listings
data_type: integer
description: |
Count of listings that the user owns or has owned.
- name: total_active_listings
data_type: integer
description: |
Count of listings that the user owns.
It contains only those that can accept bookings (hard
activation - not to be confused with activity-based
segmentation).
- name: total_listings_with_product_bundle_with_paid_service
data_type: integer
description: |
Count of listings that have, or have had, a paid service
product bundle activated.
- name: total_listings_with_active_product_bundle_with_paid_service
data_type: integer
description: |
Count of listings that currently have an active paid service
product bundle.
- name: has_active_listings
data_type: integer
description: |
Integer-based flag version of total_active_listings.
- name: has_listings_with_paid_service_applied
data_type: integer
description: |
Integer-based flag version of total_listings_with_product_bundle_with_paid_service.
- name: has_listings_with_active_paid_service_applied
data_type: integer
description: |
Integer-based flag version of total_listings_with_active_product_bundle_with_paid_service.
- name: total_bookings_with_product_bundle
data_type: integer
description: |
Count of bookings that have a product bundle associated.
- name: total_bookings_with_product_bundle_with_paid_service
data_type: integer
description: |
Count of bookings that have a product bundle associated that contain
a paid service.
- name: has_bookings_with_product_bundle
data_type: integer
description: |
Integer-based flag version of total_bookings_with_product_bundle.
- name: has_bookings_with_product_bundle_with_paid_service
data_type: integer
description: |
Integer-based flag version of total_bookings_with_product_bundle_with_paid_service.
started, depending on the billing settings of the host.