From c011743b0eaa478a3c1518ccba1081796e1fe833 Mon Sep 17 00:00:00 2001 From: Sujin Kim Date: Mon, 23 Oct 2023 16:57:00 +0900 Subject: [PATCH] fix: change `max_vfolder_count` type from BigInt to Int (#1643) --- changes/1643.fix.md | 1 + src/ai/backend/manager/models/resource_policy.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 changes/1643.fix.md diff --git a/changes/1643.fix.md b/changes/1643.fix.md new file mode 100644 index 0000000000..a0fb984cbd --- /dev/null +++ b/changes/1643.fix.md @@ -0,0 +1 @@ +To resolve the type mismatch between DB and schema, changed all schema types of `max_vfolder_count` to int. diff --git a/src/ai/backend/manager/models/resource_policy.py b/src/ai/backend/manager/models/resource_policy.py index 9818fb5697..27e7ba7768 100644 --- a/src/ai/backend/manager/models/resource_policy.py +++ b/src/ai/backend/manager/models/resource_policy.py @@ -407,7 +407,7 @@ class UserResourcePolicy(graphene.ObjectType): id = graphene.ID(required=True) name = graphene.String(required=True) created_at = GQLDateTime(required=True) - max_vfolder_count = BigInt() + max_vfolder_count = graphene.Int() max_vfolder_size = BigInt() # aliased field max_quota_scope_size = BigInt() @@ -482,12 +482,12 @@ async def batch_load_by_user( class CreateUserResourcePolicyInput(graphene.InputObjectType): - max_vfolder_count = BigInt(required=True) + max_vfolder_count = graphene.Int(required=True) max_quota_scope_size = BigInt(required=True) class ModifyUserResourcePolicyInput(graphene.InputObjectType): - max_vfolder_count = BigInt(required=True) + max_vfolder_count = graphene.Int(required=True) max_quota_scope_size = BigInt(required=True) @@ -585,7 +585,7 @@ class ProjectResourcePolicy(graphene.ObjectType): id = graphene.ID(required=True) name = graphene.String(required=True) created_at = GQLDateTime(required=True) - max_vfolder_count = BigInt() + max_vfolder_count = graphene.Int() max_vfolder_size = BigInt() # aliased field max_quota_scope_size = BigInt() @@ -660,12 +660,12 @@ async def batch_load_by_project( class CreateProjectResourcePolicyInput(graphene.InputObjectType): - max_vfolder_count = BigInt(required=True) + max_vfolder_count = graphene.Int(required=True) max_quota_scope_size = BigInt(required=True) class ModifyProjectResourcePolicyInput(graphene.InputObjectType): - max_vfolder_count = BigInt(required=True) + max_vfolder_count = graphene.Int(required=True) max_quota_scope_size = BigInt(required=True)