From 13075e1e3a91b266e65eb7e6d751a2afb19575e8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 00:48:39 +0530 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/psf/black: 23.9.1 → 23.10.1](https://github.com/psf/black/compare/23.9.1...23.10.1) - [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.6.1) * Fix type --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Pankaj --- .pre-commit-config.yaml | 6 +++--- fivetran_provider_async/hooks.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85d7972..2d11500 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-merge-conflict - id: check-yaml @@ -34,7 +34,7 @@ repos: - id: remove-tabs - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.1 hooks: - id: black @@ -51,7 +51,7 @@ repos: args: ["--profile=black"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.5.1' + rev: 'v1.6.1' hooks: - id: mypy additional_dependencies: diff --git a/fivetran_provider_async/hooks.py b/fivetran_provider_async/hooks.py index a270042..2f14607 100644 --- a/fivetran_provider_async/hooks.py +++ b/fivetran_provider_async/hooks.py @@ -164,8 +164,9 @@ def _do_api_call( if not _retryable_error(e): # In this case, the user probably made a mistake. # Don't retry. + assert e.response is not None raise AirflowException( - f"Response: {e.response.content}, " f"Status Code: {e.response.status_code}" + f"Response: {e.response.content.decode()}, " f"Status Code: {e.response.status_code}" ) self._log_request_error(attempt_num, str(e))