diff --git a/supabase/lib/client_options.py b/supabase/lib/client_options.py index ef01468b..bf9ed21b 100644 --- a/supabase/lib/client_options.py +++ b/supabase/lib/client_options.py @@ -30,7 +30,7 @@ class ClientOptions: Must be on the list of exposed schemas in Supabase. Defaults to 'public'. """ - headers: Dict[str, str] = field(default_factory=DEFAULT_HEADERS.copy) + headers: Dict[str, str] = field(default_factory=lambda: DEFAULT_HEADERS.copy) """Optional headers for initializing the client.""" auto_refresh_token: bool = True @@ -82,7 +82,7 @@ def replace( flow_type: Optional[AuthFlowType] = None, ) -> "ClientOptions": """Create a new SupabaseClientOptions with changes""" - client_options = ClientOptions() + client_options = type(self)() client_options.schema = schema or self.schema client_options.headers = headers or self.headers client_options.auto_refresh_token = ( diff --git a/tests/test_client_options.py b/tests/test_client_options.py index f35a6da7..f30a4062 100644 --- a/tests/test_client_options.py +++ b/tests/test_client_options.py @@ -2,7 +2,6 @@ from supabase import AClientOptions, ClientOptions - class TestClientOptions: def test_replace_returns_updated_aclient_options(self): storage = SyncMemoryStorage()