john-bodley commented on a change in pull request #8280: [superset] Core
SQLAlchemy query refactor
URL:
https://github.com/apache/incubator-superset/pull/8280#discussion_r333828822
##########
File path: superset/views/core.py
##########
@@ -2290,10 +2288,15 @@ def sqllab_viz(self):
SqlaTable = ConnectorRegistry.sources["table"]
data = json.loads(request.form.get("data"))
table_name = data.get("datasourceName")
- table =
db.session.query(SqlaTable).filter_by(table_name=table_name).first()
+ database_id = data.get("dbId")
+ table = (
+ db.session.query(SqlaTable)
+ .filter_by(database_id=database_id, table_name=table_name)
+ .one_or_none()
+ )
Review comment:
@dpgaspar I'm not overly familiar with the `/sqllab_viz/` route but assuming
this has to do with creating a viz from a SQL Lab query I would think the it
should probably contain the `database_id`. I gather schema is optional as it
could be undefined in SQL Lab.
----------------------------------------------------------------
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]