-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
[sqllab] proper, quoted, select * on the server side #1404
Conversation
fields = '*' | ||
table = self.get_table(table_name, schema=schema) | ||
if show_cols: | ||
fields = [quote(c.name) for c in table.columns] |
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.
I believe you wanted to quote reserved works only
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.
that sqlalchemy function only quotes reserved words
@@ -1990,7 +1993,7 @@ def select_star(self, database_id, table_name): | |||
return redirect("/tablemodelview/list/") | |||
|
|||
fields = ", ".join( | |||
[c.name for c in t.columns] or "*") | |||
[quote(c.name) for c in t.columns] or "*") |
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.
ditto
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.
that sqlalchemy function only quotes reserved words
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.
sweet!
LGTM, once test is fixed. |
Co-authored-by: John Bodley <john.bodley@airbnb.com>
Co-authored-by: John Bodley <john.bodley@airbnb.com>
Co-authored-by: John Bodley <john.bodley@airbnb.com>
Co-authored-by: John Bodley <john.bodley@airbnb.com>
Reserved words should be properly quoted now, indent is arguably better than before