Merged PR 2725: Force id user field to lower in staging

# Description

Forces lower case to all id_users in staging. Removes hardcoded lower case in intermediate. Adapts readme to contemplate the lowering of id users.

I propose to merge, run in prod and run tests in prod as a proper evaluation method.

BTW, I only find one id_user_host that was in capital letters, so that's why probably we didn't care that much about this. Still, I prefer have things clean from the start!

```
select *
from staging.stg_core__booking scb
left join intermediate.int_core__unified_user icuu
on lower(scb.id_user_host) = lower(icuu.id_user)
where scb.id_user_host <> icuu.id_user
```

# Checklist

- [ ] The edited models and dependants run properly with production data. **All models run in stg, did not check all the dependants**
- [ ] The edited models are sufficiently documented. **Have not checked**
- [ ] 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.

Related work items: #20776
This commit is contained in:
Oriol Roqué Paniagua 2024-09-03 14:36:21 +00:00
parent 1b30fbbca9
commit 6d59e21310
18 changed files with 22 additions and 22 deletions

View file

@ -25,9 +25,7 @@ from stg_core__booking b
left join int_core__booking_charge_events bce on b.id_booking = bce.id_booking
left join stg_core__booking_state bs on b.id_booking_state = bs.id_booking_state
left join int_core__duplicate_bookings db on b.id_booking = db.id_booking
left join int_core__unified_user uu on lower(b.id_user_host) = lower(uu.id_user)
-- We user 'lower' because the id_user_host can be found in capital letters or not
-- depending on the table and Postgres is case sensitive
left join int_core__unified_user uu on b.id_user_host = uu.id_user
left join
int_simple_exchange_rates ser
on (