Merged PR 5403: Removes test accounts

# Description

This PR directly removes test accounts, and not just flag them, from:
* `int_core__unified_user`, which means is also propagated to `int_core__user_host`.

It does so by creating a new, extremely simple model named: `int_core__user_test_account`

Then, `int_core__user_host` is inner joined with a small explanation comment on:
* `int_core__accommodation`
* `int_core__unique_accommodation_to_user`
* `int_core__bookings`
* `int_core__verification_requests`
* `int_core__payments`

Effectively removing test accounts.

Lastly, any existence and usage of the column `is_test_account` has been removed -> mostly on New Dash-related models.

# Checklist

**As discussed in the daily, I'll be playing around in prod with this PR**

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

Related work items: #27319
This commit is contained in:
Oriol Roqué Paniagua 2025-06-06 12:17:49 +00:00
parent 08678427ad
commit dc0abe6098
15 changed files with 76 additions and 52 deletions

View file

@ -171,6 +171,11 @@ models:
during check-in.
- name: int_core__unified_user
description: |
A model that unifies the user information from the backend.
It contains information on the user, such as name, email, phone number,
billing country, account type, and other relevant details.
Be aware that this model excludes any test account.
columns:
- name: id_user
data_type: character varying
@ -301,16 +306,9 @@ models:
- name: id_user_verification_status
data_type: bigint
description: The ID of the user verification status.
- name: is_test_account
data_type: boolean
description: |
True if the user is a test account. False otherwise.
Note that there might be other users that are test accounts
that are not controlled by this field. However it provides
a first level of filtering.
- name: int_core__vr_check_in_cover
description: |
description: |
This tables holds information on verification requests with Ckeck-in Hero
available for the guests.
@ -836,15 +834,15 @@ models:
This model is restricted to active user so it doesn't include historical data
like users that had check-in cover but are currently inactive.
The new candidate version for this model, v2, changes the strategy to
The new candidate version for this model, v2, changes the strategy to
define which hosts are offering check in cover. v1 used to look at
the verification set configurations and added hosts which had the cover in
it. v2 instead simply assumes that hosts that have had Guest Journeys
which offer the cover in the last 30 natural days are relevant. This is
it. v2 instead simply assumes that hosts that have had Guest Journeys
which offer the cover in the last 30 natural days are relevant. This is
simpler, but considered good enough. This decision was made as part of the
migration to the Guest Products data model, which would have made sticking
to the old way extremely complex and error prone.
versions:
- v: 1
- v: 2
@ -1656,13 +1654,6 @@ models:
data_type: string
description: |
Name of the account type. Can be null and might be not up-to-date.
- name: is_test_account
data_type: boolean
description: |
Flag to identify if the user is a test account.
Can be null and might be not up-to-date. Be aware that
this might not include all test accounts, but it provides
a first level of filtering.
- name: id_billing_country
data_type: integer
description: |
@ -6498,3 +6489,19 @@ models:
be false as status only reflects the latest transition.
data_tests:
- not_null
- name: int_core__user_test_account
description: |
A simple model that holds all the test accounts in the system.
This is used to identify test accounts and filter them out from
production data.
columns:
- name: id_user
data_type: character varying
description: |
Unique identifier of the user that is a test account.
It cannot be null.
data_tests:
- not_null
- unique