diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 921fdd6..7415c7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: run: make run_tests - name: Upload coverage to Coveralls + if: ${{ matrix.python-version }} == "3.12" uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/supabase_functions/_async/functions_client.py b/supabase_functions/_async/functions_client.py index 7c5cced..42d8d20 100644 --- a/supabase_functions/_async/functions_client.py +++ b/supabase_functions/_async/functions_client.py @@ -47,7 +47,10 @@ async def _request( headers: Optional[Dict[str, str]] = None, json: Optional[Dict[Any, Any]] = None, ) -> Response: - response = await self._client.request(method, url, json=json, headers=headers) + + user_data = {"data": json} if isinstance(json, str) else {"json": json} + response = await self._client.request(method, url, **user_data, headers=headers) + try: response.raise_for_status() except HTTPError as exc: diff --git a/supabase_functions/_sync/functions_client.py b/supabase_functions/_sync/functions_client.py index 1168bdf..99780eb 100644 --- a/supabase_functions/_sync/functions_client.py +++ b/supabase_functions/_sync/functions_client.py @@ -47,7 +47,10 @@ def _request( headers: Optional[Dict[str, str]] = None, json: Optional[Dict[Any, Any]] = None, ) -> Response: - response = self._client.request(method, url, json=json, headers=headers) + + user_data = {"data": json} if isinstance(json, str) else {"json": json} + response = self._client.request(method, url, **user_data, headers=headers) + try: response.raise_for_status() except HTTPError as exc: