Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fill vfolder user and group field #1837

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

fregataa
Copy link
Member

@fregataa fregataa commented Jan 12, 2024

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue
  • Installer updates including:
    • Fixtures for db schema changes
    • New mandatory config options
  • Update of end-to-end CLI integration tests in ai.backend.test
  • API server-client counterparts (e.g., manager API -> client SDK)
  • Test case(s) to:
    • Demonstrate the difference of before/after
    • Demonstrate the flow of abstract/conceptual models with a concrete implementation
  • Documentation
    • Contents in the docs directory
    • docstrings in public interfaces and type annotations

@fregataa fregataa added this to the 23.09 milestone Jan 12, 2024
@fregataa fregataa requested a review from agatha197 January 12, 2024 08:30
@fregataa fregataa self-assigned this Jan 12, 2024
@fregataa fregataa marked this pull request as draft January 12, 2024 08:30
@github-actions github-actions bot added comp:manager Related to Manager component size:S 10~30 LoC labels Jan 12, 2024
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kyujin-cho kyujin-cho marked this pull request as ready for review January 12, 2024 13:46
Comment on lines +1126 to +1140
def _get_field(name: str) -> Any:
try:
return row[name]
except sa.exc.NoSuchColumnError:
return None

return cls(
id=row["id"],
host=row["host"],
quota_scope_id=row["quota_scope_id"],
name=row["name"],
user=row["user"],
user_email=row["users_email"] if "users_email" in row else None,
user_email=_get_field("users_email"),
group=row["group"],
group_name=row["groups_name"] if "groups_name" in row else None,
group_name=_get_field("groups_name"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this for now, but please consider revamping whole column lookup logic as guarding NoSuchColumnError like here may confuse future maintainers when they accidentally failed to include column to their SELECT query.

@kyujin-cho kyujin-cho added this pull request to the merge queue Jan 12, 2024
Merged via the queue into main with commit 1f4c652 Jan 12, 2024
24 of 25 checks passed
@kyujin-cho kyujin-cho deleted the fix/vfolder-graphene-user-email branch January 12, 2024 13:53
kyujin-cho added a commit that referenced this pull request Jan 12, 2024
Co-authored-by: Kyujin Cho <[email protected]>
Backported-from: main
Backported-to: 23.09
kyujin-cho added a commit that referenced this pull request Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component size:S 10~30 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants