Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Conversation

@juancarlospaco
Copy link
Contributor

What kind of change does this PR introduce?

  • Update .pre-commit-config.yaml to use the latest versions of hooks.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @juancarlospaco - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.


def get_error_message(error: Any) -> str:
props = ["msg", "message", "error_description", "error"]
filter = (
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

"GET",
"admin/users",
query={"page": page, "per_page": per_page},
xform=lambda data: [model_validate(User, user) for user in data["users"]]
Copy link
Contributor

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.

Suggested change
xform=lambda data: [model_validate(User, user) for user in data["users"]]
xform=lambda data: [
model_validate(User, user) for user in data.get("users", [])
]

"GET",
"admin/users",
query={"page": page, "per_page": per_page},
xform=lambda data: [model_validate(User, user) for user in data["users"]]
Copy link
Contributor

Choose a reason for hiding this comment

The 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
xform=lambda data: [model_validate(User, user) for user in data["users"]]
xform=lambda data: [model_validate(User, user) for user in data.get("users", [])]

Copy link
Contributor

@J0 J0 left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM. Please wait for CI to pass before merging though

@codecov
Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.38%. Comparing base (63e028d) to head (9824403).
Report is 67 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
- Coverage   44.71%   44.38%   -0.33%     
==========================================
  Files          23       23              
  Lines        2044     2032      -12     
==========================================
- Hits          914      902      -12     
  Misses       1130     1130              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@silentworks silentworks merged commit e00452c into supabase:main May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants