-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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 the schema-fetching problem for impala in sql_lab #3906
Conversation
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 is the right approach. I just have 2 minor corrections I'd like to see.
superset/models/core.py
Outdated
@@ -726,7 +726,8 @@ def all_view_names(self, schema=None, force=False): | |||
return views | |||
|
|||
def all_schema_names(self): | |||
return sorted(self.inspector.get_schema_names()) | |||
schemas = sorted(self.db_engine_spec.get_schema_names(self.inspector)) |
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.
no need for the affectation, just return
directly
superset/db_engine_specs.py
Outdated
@@ -148,6 +148,10 @@ def adjust_database_uri(cls, uri, selected_schema): | |||
def patch(cls): | |||
pass | |||
|
|||
@classmethod | |||
def get_schema_names(cls, inspector): | |||
return sorted(inspector.get_schema_names()) |
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.
The code calling the function is already sorting, no need to sort here.
* fix the schema-fetching problem for impala in sql_lab * delete redundant print * remove blank lines... * minior corrections
* fix the schema-fetching problem for impala in sql_lab * delete redundant print * remove blank lines... * minior corrections
works for [thrift==0.9.3|0.10.0].