From cf77bebd0d7647687fe35dc7636f9b147868c0f7 Mon Sep 17 00:00:00 2001 From: Jeremy Owens Date: Wed, 11 Dec 2024 08:21:07 -0500 Subject: [PATCH] rename to `_prepare_api_call_kwargs_async` --- fivetran_provider_async/hooks.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fivetran_provider_async/hooks.py b/fivetran_provider_async/hooks.py index 2f050df..9368b78 100644 --- a/fivetran_provider_async/hooks.py +++ b/fivetran_provider_async/hooks.py @@ -634,15 +634,10 @@ class FivetranHookAsync(FivetranHook): def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) - def _prepare_api_call_kwargs(self, method: str, endpoint: str, **kwargs: Any) -> dict[str, Any]: - # Cache existing auth and remove from kwargs dict. - prior_auth = kwargs.pop("auth", None) - - kwargs = super()._prepare_api_call_kwargs(method, endpoint, **kwargs) + def _prepare_api_call_kwargs_async(self, method: str, endpoint: str, **kwargs: Any) -> dict[str, Any]: + kwargs = self._prepare_api_call_kwargs(method, endpoint, **kwargs) auth = kwargs.get("auth") - if prior_auth is not None and isinstance(prior_auth, aiohttp.BasicAuth): - kwargs["auth"] = prior_auth - elif auth is not None and is_container(auth) and 2 <= len(auth) <= 3: + if auth is not None and is_container(auth) and 2 <= len(auth) <= 3: kwargs["auth"] = aiohttp.BasicAuth(*auth) return kwargs @@ -671,7 +666,7 @@ async def _do_api_call_async( url = f"{self.api_protocol}://{self.api_host}/{endpoint}" - kwargs = self._prepare_api_call_kwargs(method, endpoint, **kwargs) + kwargs = self._prepare_api_call_kwargs_async(method, endpoint, **kwargs) async with aiohttp.ClientSession() as session: attempt_num = 1