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

[Cassandra] Change: test connection query #1474

Merged
merged 2 commits into from
Dec 20, 2016
Merged

[Cassandra] Change: test connection query #1474

merged 2 commits into from
Dec 20, 2016

Conversation

yershalom
Copy link
Contributor

…onnection

@yershalom yershalom changed the title Changed exception type to ReadTimeout and added test query for test c… [Cassandra] Changed exception type to ReadTimeout and added test query for test c… Dec 19, 2016
@@ -85,6 +86,9 @@ def run_query(self, query, user):
json_data = json.dumps(data, cls=JSONEncoder)

error = None
except ReadTimeout as e:
error = e
Copy link
Member

Choose a reason for hiding this comment

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

Error needs to be a string. But why handle ReadTimeout in a special way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I want to pass the ReadTimeout if there is a read timeout, if you think that I can remove it so I will.

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by pass it?

enabled = True
except ImportError:
enabled = False


class Cassandra(BaseQueryRunner):
noop_query = "SELECT * FROM system"
noop_query = "SELECT * FROM system.compactions_in_progress"
Copy link
Member

Choose a reason for hiding this comment

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

Every user has access to this? Is there something like SELECT 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No SELECT 1 for CQL.
Most of test queries goes in the same manner like SELECT now() FROM system.local;

@arikfr arikfr changed the title [Cassandra] Changed exception type to ReadTimeout and added test query for test c… [Cassandra] Change: test connection query Dec 20, 2016
@arikfr arikfr merged commit 8d39ee4 into getredash:master Dec 20, 2016
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