-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Update .pre-commit-config.yaml #487
Changes from all commits
83e6021
17a4db5
f0890cb
da1c0cd
d0757be
e2470f0
d0ceba0
9824403
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -113,9 +113,11 @@ def list_users(self, page: int = None, per_page: int = None) -> List[User]: | |||||
"GET", | ||||||
"admin/users", | ||||||
query={"page": page, "per_page": per_page}, | ||||||
xform=lambda data: [model_validate(User, user) for user in data["users"]] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (code_refinement): Assess the addition of parentheses in lambda functions for consistency. While this might enhance readability in some contexts, ensure it aligns with the coding standards and practices within the rest of the project.
Suggested change
|
||||||
if "users" in data | ||||||
else [], | ||||||
xform=lambda data: ( | ||||||
[model_validate(User, user) for user in data["users"]] | ||||||
if "users" in data | ||||||
else [] | ||||||
), | ||||||
) | ||||||
|
||||||
def get_user_by_id(self, uid: str) -> UserResponse: | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,8 +103,8 @@ def parse_sso_response(data: Any) -> SSOResponse: | |
|
||
def get_error_message(error: Any) -> str: | ||
props = ["msg", "message", "error_description", "error"] | ||
filter = ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (code_refinement): Review the necessity of changing the lambda function to a single line. This change might slightly reduce readability by compacting the logic into a single line. Consider if the benefits of this change outweigh the potential decrease in clarity. |
||
lambda prop: prop in error if isinstance(error, dict) else hasattr(error, prop) | ||
filter = lambda prop: ( | ||
prop in error if isinstance(error, dict) else hasattr(error, prop) | ||
) | ||
return next((error[prop] for prop in props if filter(prop)), str(error)) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (code_refinement): Consider the impact of changing lambda expressions to include additional parentheses.
This change might improve readability by making the structure of the lambda function clearer, but it could also introduce unnecessary complexity if not widely adopted across the project.