From 71276243215f512407f379870faebb4e99d1217e Mon Sep 17 00:00:00 2001 From: "maxime.c" Date: Tue, 30 Sep 2025 10:28:29 -0400 Subject: [PATCH 1/2] fix noproxy that breaks regression tests --- airbyte_cdk/sources/streams/http/http_client.py | 2 +- .../sources/streams/http/test_http_client.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/airbyte_cdk/sources/streams/http/http_client.py b/airbyte_cdk/sources/streams/http/http_client.py index 9eae35494..bade96c9c 100644 --- a/airbyte_cdk/sources/streams/http/http_client.py +++ b/airbyte_cdk/sources/streams/http/http_client.py @@ -562,7 +562,7 @@ def send_request( env_settings = self._session.merge_environment_settings( url=request.url, - proxies=request_kwargs.get("proxies"), + proxies=request_kwargs.get("proxies", {}), stream=request_kwargs.get("stream"), verify=request_kwargs.get("verify"), cert=request_kwargs.get("cert"), diff --git a/unit_tests/sources/streams/http/test_http_client.py b/unit_tests/sources/streams/http/test_http_client.py index d628a83ce..e8fd4ceb3 100644 --- a/unit_tests/sources/streams/http/test_http_client.py +++ b/unit_tests/sources/streams/http/test_http_client.py @@ -747,6 +747,22 @@ def test_given_different_headers_then_response_is_not_cached(requests_mock): assert second_response.json()["test"] == "second response" +def test_given_noproxy_for_another_url_when_send_request_then_do_not_break(requests_mock): + http_client = HttpClient(name="test", logger=MagicMock(), use_cache=True) + os.environ["no_proxy"] = "another.com" + requests_mock.register_uri( + "GET", + "https://google.com/", + json={"test": "a response"}, + ) + + x = http_client.send_request( + "GET", "https://google.com/", request_kwargs={} + ) + + assert x + + @patch.dict("os.environ", {"REQUESTS_CA_BUNDLE": "/path/to/ca-bundle.crt"}) def test_send_request_respects_environment_variables(): """Test that send_request respects REQUESTS_CA_BUNDLE environment variable.""" From 8ba271e4cbdeccc16689b3c2376a0fbe00ea241d Mon Sep 17 00:00:00 2001 From: octavia-squidington-iii Date: Tue, 30 Sep 2025 14:32:23 +0000 Subject: [PATCH 2/2] Auto-fix lint and format issues --- unit_tests/sources/streams/http/test_http_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/unit_tests/sources/streams/http/test_http_client.py b/unit_tests/sources/streams/http/test_http_client.py index e8fd4ceb3..3840c70e3 100644 --- a/unit_tests/sources/streams/http/test_http_client.py +++ b/unit_tests/sources/streams/http/test_http_client.py @@ -756,9 +756,7 @@ def test_given_noproxy_for_another_url_when_send_request_then_do_not_break(reque json={"test": "a response"}, ) - x = http_client.send_request( - "GET", "https://google.com/", request_kwargs={} - ) + x = http_client.send_request("GET", "https://google.com/", request_kwargs={}) assert x