From 85fa58f5a93588426b804ce5a91d4bcd3259ce99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Wed, 5 Feb 2025 15:54:19 +0000 Subject: [PATCH] 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 --- models/intermediate/core/int_core__booking_to_service.sql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/models/intermediate/core/int_core__booking_to_service.sql b/models/intermediate/core/int_core__booking_to_service.sql index 6d7db0b..40997d0 100644 --- a/models/intermediate/core/int_core__booking_to_service.sql +++ b/models/intermediate/core/int_core__booking_to_service.sql @@ -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 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 - int_core__user_host uh - on b.id_user_host = uh.id_user_host - and uh.is_test_account = false +left join int_core__user_host uh on b.id_user_host = uh.id_user_host left join stg_core__booking_to_product_bundle btpb on b.id_booking = btpb.id_booking @@ -69,3 +66,4 @@ left join left join stg_core__user_product_bundle upb on btpb.id_user_product_bundle = upb.id_user_product_bundle +where uh.is_test_account = false