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: Update rpc return type #702

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions supabase/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from gotrue.types import AuthChangeEvent, Session
from httpx import Timeout
from postgrest import (
AsyncFilterRequestBuilder,
AsyncPostgrestClient,
AsyncRequestBuilder,
AsyncRPCFilterRequestBuilder,
)
from postgrest.constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
from storage3 import AsyncStorageClient
Expand Down Expand Up @@ -119,7 +119,7 @@
"""
return self.postgrest.from_(table_name)

def rpc(self, fn: str, params: Dict[Any, Any]) -> AsyncFilterRequestBuilder:
def rpc(self, fn: str, params: Dict[Any, Any] = {}) -> AsyncRPCFilterRequestBuilder:

Check warning on line 122 in supabase/_async/client.py

View check run for this annotation

Codecov / codecov/patch

supabase/_async/client.py#L122

Added line #L122 was not covered by tests
silentworks marked this conversation as resolved.
Show resolved Hide resolved
silentworks marked this conversation as resolved.
Show resolved Hide resolved
"""Performs a stored procedure call.

Parameters
Expand Down
8 changes: 6 additions & 2 deletions supabase/_sync/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
from gotrue import SyncMemoryStorage
from gotrue.types import AuthChangeEvent, Session
from httpx import Timeout
from postgrest import SyncFilterRequestBuilder, SyncPostgrestClient, SyncRequestBuilder
from postgrest import (
SyncPostgrestClient,
SyncRequestBuilder,
SyncRPCFilterRequestBuilder,
)
from postgrest.constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
from storage3 import SyncStorageClient
from storage3.constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
Expand Down Expand Up @@ -115,7 +119,7 @@ def from_(self, table_name: str) -> SyncRequestBuilder:
"""
return self.postgrest.from_(table_name)

def rpc(self, fn: str, params: Dict[Any, Any]) -> SyncFilterRequestBuilder:
def rpc(self, fn: str, params: Dict[Any, Any] = {}) -> SyncRPCFilterRequestBuilder:
silentworks marked this conversation as resolved.
Show resolved Hide resolved
"""Performs a stored procedure call.

Parameters
Expand Down
Loading