From 52b86bc0c4ae7fc65bfee50e59967d0f09aa9c4b Mon Sep 17 00:00:00 2001 From: Aliaksandr Kuzmik <98702584+alexkuzmik@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:28:17 +0100 Subject: [PATCH] [NA] Migrate from session.send to session.request (#104) * Roll back to stateless requests. Reason: problem with SSL certificate verification which requires additional work and testing * Return back session object, use session.request instead of session.send(prepared_request) * Remove comments --- src/comet_llm/experiment_api/comet_api_client.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/comet_llm/experiment_api/comet_api_client.py b/src/comet_llm/experiment_api/comet_api_client.py index 514ebc1949..0be5ead36b 100644 --- a/src/comet_llm/experiment_api/comet_api_client.py +++ b/src/comet_llm/experiment_api/comet_api_client.py @@ -122,10 +122,13 @@ def log_experiment_other( def _request(self, method: str, path: str, *args, **kwargs) -> ResponseContent: # type: ignore url = urllib.parse.urljoin(self._comet_url, path) - request = requests.Request(method, url, headers=self._headers, *args, **kwargs) - - response = self._session.send(request.prepare()) - + response = self._session.request( + method=method, + url=url, + headers=self._headers, + *args, + **kwargs, + ) response.raise_for_status() return response.json()