villebro commented on a change in pull request #7646: Compile example column
names
URL:
https://github.com/apache/incubator-superset/pull/7646#discussion_r293514456
##########
File path: superset/data/birth_names.py
##########
@@ -64,15 +65,18 @@ def load_birth_names():
obj.filter_select_enabled = True
if not any(col.column_name == 'num_california' for col in obj.columns):
+ col_state = str(column('state').compile(db.engine))
Review comment:
I believe `sqlalchemy.sql.compiler.IdentifierPreparer` and it's method
`quote` is a slightly lower level construct, and I was personally unable to get
it to work properly. In my experience it is recommended to always use
SQLAlchemy factory functions when possible; same reason why columns are usually
made by calling `sqlalchemy.sql.column`, not directly creating an instance of
`sqlalchemy.sql.elements.ColumnClause`, which is what `column` ultimately
returns. Personally I find this slightly confusing, but I believe the design is
made to decouple the implementation code from the inner workings of SQLAlchemy.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]