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?

  • Tiny fixes and proper code style.

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: 5 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.

if self.headers.get(
"Accept"
) and "application/vnd.pgrst.plan" in self.headers.get("Accept"):
if not "+json" in self.headers.get("Accept"):
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): Improved readability with 'not in' for membership test.

Suggested change
if not "+json" in self.headers.get("Accept"):
if "+json" not in self.headers.get("Accept"):

raise APIError(r.json())
except ValidationError as e:
raise APIError(r.json()) from e
except JSONDecodeError as e:
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): Removal of unused exception variable 'e' is a good practice.

Suggested change
except JSONDecodeError as e:
except JSONDecodeError:
raise APIError(generate_default_error_message(r))

raise APIError(r.json())
except ValidationError as e:
raise APIError(r.json()) from e
except JSONDecodeError as e:
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): Good removal of the unused variable 'e' in exception handling.

) -> Self:
try:
data = request_response.json()
except JSONDecodeError as e:
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): Efficient use of exception handling by removing unused variable 'e'.

Suggested change
except JSONDecodeError as e:
except JSONDecodeError:
raise APIError(generate_default_error_message(r))

if self.headers.get(
"Accept"
) and "application/vnd.pgrst.plan" in self.headers.get("Accept"):
if not "+json" in self.headers.get("Accept"):
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): Consistency in using 'not in' for membership checks enhances code readability.

Suggested change
if not "+json" in self.headers.get("Accept"):
if "+json" not in self.headers.get("Accept"):

@codecov
Copy link

codecov bot commented May 5, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 95.91%. Comparing base (b858685) to head (e2267b9).
Report is 28 commits behind head on master.

Files Patch % Lines
postgrest/_async/request_builder.py 66.66% 1 Missing ⚠️
postgrest/base_request_builder.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #425      +/-   ##
==========================================
+ Coverage   95.72%   95.91%   +0.18%     
==========================================
  Files          28       28              
  Lines        1639     1715      +76     
==========================================
+ Hits         1569     1645      +76     
  Misses         70       70              

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

@silentworks silentworks merged commit 11076da into supabase:master May 26, 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