Skip to content

Commit 513fef1

Browse files
committed
Revert "fix: properly join url and path when calculating full url (#692)"
This reverts commit 950acc6.
1 parent db1e4c0 commit 513fef1

File tree

2 files changed

+1
-51
lines changed

2 files changed

+1
-51
lines changed

airbyte_cdk/sources/declarative/requesters/http_requester.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,7 @@ def _get_url(
168168
next_page_token=next_page_token,
169169
)
170170

171-
full_url = (
172-
self._join_url(url_base, path)
173-
if url_base
174-
else self._join_url(url, path)
175-
if path
176-
else url
177-
)
171+
full_url = self._join_url(url_base, path) if url_base else url + path if path else url
178172

179173
return full_url
180174

unit_tests/sources/declarative/requesters/test_http_requester.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -861,50 +861,6 @@ def test_join_url(test_name, base_url, path, expected_full_url):
861861
assert sent_request.url == expected_full_url
862862

863863

864-
@pytest.mark.parametrize(
865-
"test_name, url, path, expected_full_url",
866-
[
867-
("test_no_path", "https://airbyte.io/my_endpoint", None, "https://airbyte.io/my_endpoint"),
868-
(
869-
"test_path_does_not_include_url",
870-
"https://airbyte.io/my_endpoint",
871-
"with_path",
872-
"https://airbyte.io/my_endpoint/with_path",
873-
),
874-
(
875-
"test_path_does_include_url",
876-
"https://airbyte.io/my_endpoint",
877-
"https://airbyte.io/my_endpoint/with_path",
878-
"https://airbyte.io/my_endpoint/with_path",
879-
),
880-
(
881-
"test_path_is_different_full_url",
882-
"https://airbyte.io/my_endpoint",
883-
"https://airbyte-paginated.io/my_paginated_endpoint",
884-
"https://airbyte-paginated.io/my_paginated_endpoint",
885-
),
886-
],
887-
)
888-
def test_join_url_with_url_and_path(test_name, url, path, expected_full_url):
889-
requester = HttpRequester(
890-
name="name",
891-
url=url,
892-
path=path,
893-
http_method=HttpMethod.GET,
894-
request_options_provider=None,
895-
config={},
896-
parameters={},
897-
error_handler=DefaultErrorHandler(parameters={}, config={}),
898-
)
899-
requester._http_client._session.send = MagicMock()
900-
response = requests.Response()
901-
response.status_code = 200
902-
requester._http_client._session.send.return_value = response
903-
requester.send_request()
904-
sent_request: PreparedRequest = requester._http_client._session.send.call_args_list[0][0][0]
905-
assert sent_request.url == expected_full_url
906-
907-
908864
@pytest.mark.usefixtures("mock_sleep")
909865
def test_request_attempt_count_is_tracked_across_retries(http_requester_factory):
910866
request_mock = MagicMock(spec=requests.PreparedRequest)

0 commit comments

Comments
 (0)