Skip to content

Commit

Permalink
fix: maybe_single with no matching rows returns None (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar-balwani authored Sep 8, 2023
1 parent ed6928a commit a5efce6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion postgrest/_async/request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async def execute(self) -> Optional[SingleAPIResponse]:
try:
r = await super().execute()
except APIError as e:
if e.details and "Results contain 0 rows" in e.details:
if e.details and "The result contains 0 rows" in e.details:
return None
if not r:
raise APIError(
Expand Down
2 changes: 1 addition & 1 deletion postgrest/_sync/request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def execute(self) -> Optional[SingleAPIResponse]:
try:
r = super().execute()
except APIError as e:
if e.details and "Results contain 0 rows" in e.details:
if e.details and "The result contains 0 rows" in e.details:
return None
if not r:
raise APIError(
Expand Down

0 comments on commit a5efce6

Please sign in to comment.