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 1 commit
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
2 changes: 1 addition & 1 deletion redash/query_runner/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _send_query(self, data, stream=False):
timeout=self.configuration.get('timeout', 30),
params={
'user': self.configuration['user'],
Copy link
Member

Choose a reason for hiding this comment

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

I just realized that we have the same problem with user and url. We should call .get with the value we mention as default in the configuration properties.

Copy link
Member Author

@aidarbek aidarbek Jan 30, 2019

Choose a reason for hiding this comment

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

I faced an error while building PR with CircleCI https://circleci.com/gh/getredash/redash/11656

ERROR: Service 'redash' failed to build: The command '/bin/sh -c pip install -r requirements.txt -r requirements_dev.txt' returned a non-zero code: 2

I guess the problems is not in my PR? Could you please rerun workflow at some point in future?

Copy link
Member

Choose a reason for hiding this comment

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

It's definitely unrelated. I triggered another execution.

'password': self.configuration['password'],
'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