-
Notifications
You must be signed in to change notification settings - Fork 46
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
add druid client #39
add druid client #39
Conversation
omniduct/databases/druid.py
Outdated
self.__druid = connect(self.host, self.port, path='/druid/v2/sql/', scheme='http') | ||
|
||
def _is_connected(self): | ||
return hasattr(self, '__druid') and self.__druid is not None |
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.
hasattr
doesn't seem to be necessary here, given that it is explicitly set in the init method.
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.
udpated!
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.
This looks good to me! Nice contribution.
I left a few comments where the client could be plausibly improved, but hardly anything worth worrying about 👍
logger.info('Disconnecting from Druid database ...') | ||
try: | ||
self.__druid.close() | ||
except Exception: |
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.
Do you know what the Druid client raises if it is not connected?
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.
It's sometimes buggy so I'm going to leave this as is for now
druid-io/pydruid#119
omniduct/databases/druid.py
Outdated
self.__druid = connect(self.host, self.port, path='/druid/v2/sql/', scheme='http') | ||
|
||
def _is_connected(self): | ||
return hasattr(self, '__druid') and self.__druid is not None |
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.
Does druid
have a way to check if it is connected?
1c56b67
to
32813bb
Compare
32813bb
to
3a89008
Compare
@matthewwardrop Druid now supports SQL