Skip to content

Commit

Permalink
[NA] Migrate from session.send to session.request (#104)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
alexkuzmik authored Nov 30, 2023
1 parent 6af8e11 commit 52b86bc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/comet_llm/experiment_api/comet_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 52b86bc

Please sign in to comment.