You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "betodealmeida (via GitHub)" <gi...@apache.org> on 2023/06/01 17:23:25 UTC

[GitHub] [superset] betodealmeida commented on a diff in pull request #19808: fix(sql-lab): SQL Lab commit connection even if no CTA query is made

betodealmeida commented on code in PR #19808:
URL: https://github.com/apache/superset/pull/19808#discussion_r1213463028


##########
superset/sql_lab.py:
##########
@@ -490,9 +490,9 @@ def execute_sql_statements(  # pylint: disable=too-many-arguments, too-many-loca
                     ex, query, session, payload, prefix_message
                 )
                 return payload
-
         # Commit the connection so CTA queries will create the table.
-        conn.commit()
+        if apply_ctas:
+            conn.commit()

Review Comment:
   I think this is fine, and the `commit` might not even be needed at all (but does no harm) since we close the connection after (exiting the context manager) and open a new one when running `select_star`.
   
   (I wonder if the `commit` was needed before we added the `closing` context manager...)



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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