Skip to content

Commit

Permalink
fix: change max_vfolder_count type from BigInt to Int (#1643)
Browse files Browse the repository at this point in the history
Backported-from: main
Backported-to: 23.09
  • Loading branch information
agatha197 authored and achimnol committed Nov 6, 2023
1 parent 047dae4 commit 3d9a886
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions changes/1643.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
To resolve the type mismatch between DB and schema, changed all schema types of `max_vfolder_count` to int.
16 changes: 11 additions & 5 deletions src/ai/backend/manager/models/resource_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ class UserResourcePolicy(graphene.ObjectType):
name = graphene.String(required=True)
created_at = GQLDateTime(required=True)
max_vfolder_size = BigInt(deprecation_reason="Deprecated since 23.09.1")
max_vfolder_count = graphene.Int()
max_quota_scope_size = BigInt()

@classmethod
Expand Down Expand Up @@ -490,11 +491,13 @@ async def batch_load_by_user(


class CreateUserResourcePolicyInput(graphene.InputObjectType):
max_quota_scope_size = BigInt()
max_vfolder_count = graphene.Int(required=True)
max_quota_scope_size = BigInt(required=True)


class ModifyUserResourcePolicyInput(graphene.InputObjectType):
max_quota_scope_size = BigInt()
max_vfolder_count = graphene.Int(required=True)
max_quota_scope_size = BigInt(required=True)


class CreateUserResourcePolicy(graphene.Mutation):
Expand Down Expand Up @@ -588,7 +591,8 @@ class ProjectResourcePolicy(graphene.ObjectType):
id = graphene.ID(required=True)
name = graphene.String(required=True)
created_at = GQLDateTime(required=True)
max_vfolder_size = BigInt(deprecation_reason="Deprecated since 23.09.1")
max_vfolder_count = graphene.Int()
max_vfolder_size = BigInt() # aliased field
max_quota_scope_size = BigInt()

@classmethod
Expand Down Expand Up @@ -661,11 +665,13 @@ async def batch_load_by_project(


class CreateProjectResourcePolicyInput(graphene.InputObjectType):
max_quota_scope_size = BigInt()
max_vfolder_count = graphene.Int(required=True)
max_quota_scope_size = BigInt(required=True)


class ModifyProjectResourcePolicyInput(graphene.InputObjectType):
max_quota_scope_size = BigInt()
max_vfolder_count = graphene.Int(required=True)
max_quota_scope_size = BigInt(required=True)


class CreateProjectResourcePolicy(graphene.Mutation):
Expand Down

0 comments on commit 3d9a886

Please sign in to comment.