From 9668281a4e824cfe9d102514ef4131ae97036fa6 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Thu, 16 Mar 2023 10:21:53 +0000 Subject: [PATCH] Do not use coalesce for consumers.uuid The consumers.uuid and allocations.consumer_id are not Nullable. Change-Id: I37065f7eb0809921a885f62ad6f30e6a2fbfd174 --- placement/objects/allocation.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/placement/objects/allocation.py b/placement/objects/allocation.py index fe1fad783..e56f44d1c 100644 --- a/placement/objects/allocation.py +++ b/placement/objects/allocation.py @@ -263,8 +263,7 @@ def _get_allocations_by_provider_id(ctx, rp_id): allocs.c.created_at, consumers.c.id.label("consumer_id"), consumers.c.generation.label("consumer_generation"), - sql.func.coalesce( - consumers.c.uuid, allocs.c.consumer_id).label("consumer_uuid"), + consumers.c.uuid.label("consumer_uuid"), projects.c.id.label("project_id"), projects.c.external_id.label("project_external_id"), users.c.id.label("user_id"), @@ -303,8 +302,7 @@ def _get_allocations_by_consumer_uuid(ctx, consumer_uuid): consumer.c.id.label("consumer_id"), consumer.c.generation.label("consumer_generation"), consumer.c.consumer_type_id, - sql.func.coalesce( - consumer.c.uuid, allocs.c.consumer_id).label("consumer_uuid"), + consumer.c.uuid.label("consumer_uuid"), project.c.id.label("project_id"), project.c.external_id.label("project_external_id"), user.c.id.label("user_id"),