From 2695c0c9dbbfbe43e2a8f5f06ebe8a73687d15cc Mon Sep 17 00:00:00 2001 From: Alexandre Girard Date: Wed, 27 Jul 2022 08:17:40 -0700 Subject: [PATCH] fix build (#15068) --- .../python/airbyte_cdk/sources/declarative/read_exception.py | 2 ++ .../sources/declarative/retrievers/test_simple_retriever.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/read_exception.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/read_exception.py index 3c9a0cc0f43..160cdcb43f0 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/read_exception.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/read_exception.py @@ -1,6 +1,8 @@ # # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # + + class ReadException(Exception): """ Raise when there is an error reading data from an API Source diff --git a/airbyte-cdk/python/unit_tests/sources/declarative/retrievers/test_simple_retriever.py b/airbyte-cdk/python/unit_tests/sources/declarative/retrievers/test_simple_retriever.py index b759d2c9ec3..5d8baa18044 100644 --- a/airbyte-cdk/python/unit_tests/sources/declarative/retrievers/test_simple_retriever.py +++ b/airbyte-cdk/python/unit_tests/sources/declarative/retrievers/test_simple_retriever.py @@ -8,6 +8,7 @@ import airbyte_cdk.sources.declarative.requesters.error_handlers.response_status import pytest import requests from airbyte_cdk.models import SyncMode +from airbyte_cdk.sources.declarative.read_exception import ReadException from airbyte_cdk.sources.declarative.requesters.error_handlers.response_action import ResponseAction from airbyte_cdk.sources.declarative.requesters.error_handlers.response_status import ResponseStatus from airbyte_cdk.sources.declarative.requesters.request_option import RequestOptionType @@ -136,7 +137,7 @@ def test_parse_response(test_name, status_code, response_status, len_expected_re try: retriever.parse_response(response, stream_state={}) assert False - except requests.exceptions.HTTPError: + except ReadException: pass else: records = retriever.parse_response(response, stream_state={})