File tree 1 file changed +21
-0
lines changed
agenta-backend/agenta_backend/services
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 63
63
)
64
64
from agenta_backend .models .db_models import (
65
65
TemplateDB ,
66
+ IDsMappingDB ,
66
67
AppVariantRevisionsDB ,
67
68
HumanEvaluationVariantDB ,
68
69
EvaluationScenarioResultDB ,
@@ -3094,3 +3095,23 @@ async def check_if_evaluation_contains_failed_evaluation_scenarios(
3094
3095
if not count :
3095
3096
return False
3096
3097
return count > 0
3098
+
3099
+
3100
+ async def fetch_corresponding_object_uuid (table_name : str , object_id : str ) -> str :
3101
+ """
3102
+ Fetches a corresponding object uuid.
3103
+
3104
+ Args:
3105
+ table_name (str): The table name
3106
+ object_id (str): The object identifier
3107
+
3108
+ Returns:
3109
+ The corresponding object uuid as string.
3110
+ """
3111
+
3112
+ async with db_engine .get_session () as session :
3113
+ result = await session .execute (
3114
+ select (IDsMappingDB ).filter_by (table_name = table_name , objectid = object_id )
3115
+ )
3116
+ object_mapping = result .scalars ().first ()
3117
+ return str (object_mapping .uuid )
You can’t perform that action at this time.
0 commit comments