Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending empty batch results in weird timeout error #5

Open
sheepsy90 opened this issue Jul 11, 2023 · 0 comments
Open

Sending empty batch results in weird timeout error #5

sheepsy90 opened this issue Jul 11, 2023 · 0 comments

Comments

@sheepsy90
Copy link

sheepsy90 commented Jul 11, 2023

When doing:

client.send(Batch([]))

i am getting:

Traceback` (most recent call last):
File "/home/robert/repositories/homeq/playground10.py", line 19, in
client.send(Batch([]))
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/recombee_api_client/api_client.py", line 66, in send
return self.__post(request, uri, timeout)
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/recombee_api_client/api_client.py", line 118, in __post
response = requests.post(uri,
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/requests/api.py", line 117, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/requests/adapters.py", line 435, in send
timeout = TimeoutSauce(connect=timeout, read=timeout)
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/urllib3/util/timeout.py", line 96, in init
self._connect = self._validate_timeout(connect, "connect")
File "/home/robert/repositories/homeq/venv/lib/python3.9/site-packages/urllib3/util/timeout.py", line 144, in _validate_timeout
raise ValueError(
ValueError: Attempted to set connect timeout to 0.0, but the timeout cannot be set to a value less than or equal to 0.

Process finished with exit code 1

Probably should rather raise something that prevents the thing from going forward at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant