Merged PR 4287: Bugfix - Ensure exclusion of test account at where condition

# Description

The condition on the left join created some records with null info from user host thus raising errors.
This is now fixed by ensuring these get excluded after the join

# Checklist

- [X] The edited models and dependants run properly with production data.
- [ ] 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: #27319
This commit is contained in:
Oriol Roqué Paniagua 2025-02-05 15:54:19 +00:00
parent 3919539786
commit 85fa58f5a9

View file

@ -58,10 +58,7 @@ from stg_core__booking_view_to_service bvts
inner join stg_core__booking_view bv on bvts.id_booking_view = bv.id_booking_view inner join stg_core__booking_view bv on bvts.id_booking_view = bv.id_booking_view
left join stg_core__booking b on bv.id_booking = b.id_booking left join stg_core__booking b on bv.id_booking = b.id_booking
left join stg_core__booking_state bs on b.id_booking_state = bs.id_booking_state left join stg_core__booking_state bs on b.id_booking_state = bs.id_booking_state
left join left join int_core__user_host uh on b.id_user_host = uh.id_user_host
int_core__user_host uh
on b.id_user_host = uh.id_user_host
and uh.is_test_account = false
left join left join
stg_core__booking_to_product_bundle btpb stg_core__booking_to_product_bundle btpb
on b.id_booking = btpb.id_booking on b.id_booking = btpb.id_booking
@ -69,3 +66,4 @@ left join
left join left join
stg_core__user_product_bundle upb stg_core__user_product_bundle upb
on btpb.id_user_product_bundle = upb.id_user_product_bundle on btpb.id_user_product_bundle = upb.id_user_product_bundle
where uh.is_test_account = false