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: make ClickHouse password and username truly optional #3362

Merged
merged 2 commits into from
Jan 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions redash/query_runner/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def _get_tables(self, schema):

def _send_query(self, data, stream=False):
r = requests.post(
self.configuration['url'],
self.configuration.get('url', "http://127.0.0.1:8123"),
data=data.encode("utf-8"),
stream=stream,
timeout=self.configuration.get('timeout', 30),
params={
'user': self.configuration['user'],
'password': self.configuration['password'],
'user': self.configuration.get('user', "default"),
'password': self.configuration.get('password', ""),
'database': self.configuration['dbname']
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we will use .get('dbname', 'default')?

Copy link
Member

Choose a reason for hiding this comment

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

Well, at the moment dbname is a required field, so it's guaranteed we will have a value for it.

Copy link
Member

@denisov-vlad denisov-vlad Jan 30, 2019

Choose a reason for hiding this comment

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

I didn't want to post the same comment on 2 lines. :)

I think that dbname param should be not required if we agree that user and password fields could be not required too.

Copy link
Member

Choose a reason for hiding this comment

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

👍 got it. I'm going to merge this as is. But I don't mind making dbname optional. I just don't want to throw more work at @aidarbek :)

}
)
Expand Down