You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/09/17 22:17:50 UTC

[GitHub] [incubator-superset] serenajiang commented on a change in pull request #8224: [sqllab] create query slightly earlier

serenajiang commented on a change in pull request #8224: [sqllab] create query slightly earlier
URL: https://github.com/apache/incubator-superset/pull/8224#discussion_r325410020
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -2608,11 +2601,21 @@ def sql_json(self):
         session.add(query)
         session.flush()
         query_id = query.id
-        session.commit()  # shouldn't be necessary
+        session.commit()
 
 Review comment:
   afaik, flushing actually doesn't actually affect the database, just the session. If something went wrong before a commit, the query creation would be rolled back. I'm actually not sure if `session.flush()` is necessary in this case, but I think `session.commit()` is.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org