-
Notifications
You must be signed in to change notification settings - Fork 2
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
Python driver implements DB-API. #8
base: master
Are you sure you want to change the base?
Conversation
52f5aab
to
1352fec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thank you, this is truly awesome work Ievgen!!!
Left just a few nits, no rush, really.. Thank you!
driver/python/cursor.py
Outdated
self.rowcount = self._set_data(descriptors, resp.rows) | ||
else: | ||
self.rowcount = 0 | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this loop's structure could be refactored a bit or at least the order of the two resp.status == if statements could be flipped (and maybe use else-if for the 2nd), so it is better visible that we only retry if it's a REDIRECT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
with urlopen(self.health_check_url) as resp: | ||
if HTTPStatus.OK == resp.getcode(): | ||
return True | ||
except URLError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in which case(s) can we get an URLError here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connection or internal DB errors.
Run tests:
bazel test //driver/python:all_tests --test_output=streamed --runs_per_test=2