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

[sqllab] proper, quoted, select * on the server side #1404

Merged
merged 2 commits into from
Oct 21, 2016

Conversation

mistercrunch
Copy link
Member

Reserved words should be properly quoted now, indent is arguably better than before
screen shot 2016-10-21 at 12 29 32 am

fields = '*'
table = self.get_table(table_name, schema=schema)
if show_cols:
fields = [quote(c.name) for c in table.columns]
Copy link
Member

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

Copy link
Member Author

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 "*")
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

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

sweet!

@bkyryliuk
Copy link
Member

LGTM, once test is fixed.

@mistercrunch mistercrunch merged commit 63161b1 into apache:master Oct 21, 2016
@mistercrunch mistercrunch deleted the select_star branch October 21, 2016 23:55
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 17, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 24, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 25, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 26, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.12.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants