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

Fix TypeError when timeout is provided in connection string #106

Conversation

piby180
Copy link
Contributor

@piby180 piby180 commented Jul 13, 2024

When timeout is provided as a query parameter in connection string, like the following

'pinot://localhost:8000/query/sql?controller='
       'http://localhost:9000/&&verify_ssl=True&&timeout=100'

we get TypeError : 'str' can't be converted to int

We need to convert timeout from string to int and then use it. This is fixed in this PR.

@piby180 piby180 changed the title Fix type error when Fix TypeError when timeout is provided in connection string Fix TypeError when timeout is provided in connection string Jul 13, 2024
@xiangfu0
Copy link
Contributor

can you please fix the test ?

@xiangfu0 xiangfu0 self-requested a review July 14, 2024 02:25
@piby180
Copy link
Contributor Author

piby180 commented Jul 14, 2024

@xiangfu0 Test has been fixed. The issue was that timeout in test here was being converted to 0 since int(0.001) = 0.

I have now used float() for timeout instead of int() which is also consistent with httpx as timeout datatype there is union of float and Nonetype.

@xiangfu0 xiangfu0 merged commit 5d917e4 into python-pinot-dbapi:master Jul 14, 2024
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.

2 participants