Skip to content

Commit

Permalink
requirements freeze + revert changes on build_url method
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert Sedlacek committed Dec 5, 2024
1 parent 5889b9b commit 494d012
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
19 changes: 9 additions & 10 deletions python-sync-actions/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
keboola.component
dataconf
keboola.http-client
keboola.utils
keboola.json-to-csv
mock
freezegun
nested-lookup
python-dateutil
camel-tools
keboola.component==1.6.8
dataconf==3.3.0
keboola.http-client==1.0.1
keboola.utils==1.1.2
keboola.json-to-csv==0.0.12
mock==5.1.0
freezegun==1.5.1
nested-lookup==0.2.25
python-dateutil==2.9.0.post0
18 changes: 3 additions & 15 deletions python-sync-actions/src/http_generic/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from keboola.http_client import HttpClient
from requests.adapters import HTTPAdapter
from requests.exceptions import HTTPError, InvalidJSONError, ConnectionError
import urllib.parse as urlparse
from urllib3 import Retry

from http_generic.auth import AuthMethodBase
Expand Down Expand Up @@ -63,20 +62,9 @@ def send_request(self, method, endpoint_path, **kwargs):
message = f'Request "{method}: {endpoint_path}" failed with the following error: {e}'
raise HttpClientError(message, resp) from e

def build_url(self, base_url, endpoint_path, is_absolute_path=False):
url_path = str(endpoint_path).strip() if endpoint_path is not None else ''

if not url_path:
url = base_url

elif not is_absolute_path:
full_path = urlparse.urljoin(base_url, url_path)
url = urlparse.quote(full_path, safe="/()=<>-&")

else:
url = urlparse.quote(url_path, safe="/()=<>-&")

return url
def build_url(self, base_url, endpoint_path):
self.base_url = base_url
return self._build_url(endpoint_path)

# override to continue on retry error
def _requests_retry_session(self, session=None):
Expand Down

0 comments on commit 494d012

Please sign in to comment.