Skip to content

Commit

Permalink
fix: provide deprecation msg to deprecated graphene fields
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed Oct 23, 2023
1 parent 429c155 commit 6c06ed9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/ai/backend/manager/api/vfolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,10 @@ async def update_quota(request: web.Request, params: Any) -> web.Response:
if len(entries) == 0:
raise VFolderNotFound(extra_data=params["id"])

# Limit vfolder size quota if it is larger than max_vfolder_size of the resource policy.
max_vfolder_size = resource_policy.get("max_vfolder_size", 0)
if max_vfolder_size > 0 and (quota <= 0 or quota > max_vfolder_size):
quota = max_vfolder_size
# Limit vfolder size quota if it is larger than max_quota_scope_size of the resource policy.
max_quota_scope_size = resource_policy.get("max_quota_scope_size", 0)
if max_quota_scope_size > 0 and (quota <= 0 or quota > max_quota_scope_size):
quota = max_quota_scope_size

async with root_ctx.storage_manager.request(
proxy_name,
Expand Down
4 changes: 2 additions & 2 deletions src/ai/backend/manager/models/resource_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class UserResourcePolicy(graphene.ObjectType):
name = graphene.String(required=True)
created_at = GQLDateTime(required=True)
max_vfolder_count = BigInt()
max_vfolder_size = BigInt() # aliased field
max_vfolder_size = BigInt(deprecation_reason="Deprecated since 23.09.1") # aliased field
max_quota_scope_size = BigInt()

@classmethod
Expand Down Expand Up @@ -586,7 +586,7 @@ class ProjectResourcePolicy(graphene.ObjectType):
name = graphene.String(required=True)
created_at = GQLDateTime(required=True)
max_vfolder_count = BigInt()
max_vfolder_size = BigInt() # aliased field
max_vfolder_size = BigInt(deprecation_reason="Deprecated since 23.09.1") # aliased field
max_quota_scope_size = BigInt()

@classmethod
Expand Down

0 comments on commit 6c06ed9

Please sign in to comment.