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

Added support for providing a timeout option while setting up a connection #85

Merged

Conversation

aishikbh
Copy link
Contributor

@aishikbh aishikbh commented Nov 15, 2023

Added support for adding a timeout option (in seconds) while setting up a connection. If no timeout is provided, the default behaviour is to have no timeouts.

…ion. Changed the default behaviour to not have any timeout if the option is not provided.
@aishikbh aishikbh changed the title Added support for providing a timeout option while setting up a connection. Added support for providing a timeout option while setting up a connection Nov 15, 2023
Copy link

@snleee snleee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comments before merging. Otherwise, LGTM

pinotdb/db.py Show resolved Hide resolved
pinotdb/db.py Outdated Show resolved Hide resolved
@walterddr
Copy link
Collaborator

can we add some tests? there's no need to validate the query result but better to validate that the timeout actually is in effect

  • setting to 1ms and see if it actually times out
  • setting it explicitly to None and see if it follows default
  • other scenarios

@aishikbh
Copy link
Contributor Author

can we add some tests? there's no need to validate the query result but better to validate that the timeout actually is in effect

  • setting to 1ms and see if it actually times out
  • setting it explicitly to None and see if it follows default
  • other scenarios

I have added the tests.

examples/pinot_quickstart_timeout.py Outdated Show resolved Hide resolved
examples/pinot_quickstart_timeout.py Outdated Show resolved Hide resolved
Comment on lines +36 to +37
with pytest.raises(httpx.ReadTimeout):
curs.execute(sql)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not very familiar with pytest, this is try to catch and expected httpx.ReadTimeout and will fail the test when timeout is not thrown correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that is correct

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@walterddr walterddr merged commit 11a8b66 into python-pinot-dbapi:master Nov 16, 2023
10 checks passed
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

Successfully merging this pull request may close these issues.

3 participants