You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/03/10 17:47:54 UTC

[airflow] branch main updated: Update documentation for snowflake provider 4.0 breaking change (#30020)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b9c231ceb0 Update documentation for snowflake provider 4.0 breaking change (#30020)
b9c231ceb0 is described below

commit b9c231ceb0f3053a27744b80e95f08ac0684fe38
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Fri Mar 10 18:47:46 2023 +0100

    Update documentation for snowflake provider 4.0 breaking change (#30020)
    
    The 4.0 version of Snowflake was breaking a little more than we
    described it originally, This PR adds explicit mentioning of the
    autocommit flag change.
    
    Fixes: #30010
---
 airflow/providers/snowflake/CHANGELOG.rst          | 6 ++++++
 airflow/providers/snowflake/operators/snowflake.py | 2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/airflow/providers/snowflake/CHANGELOG.rst b/airflow/providers/snowflake/CHANGELOG.rst
index 96b99c2fdd..5d9cfffec6 100644
--- a/airflow/providers/snowflake/CHANGELOG.rst
+++ b/airflow/providers/snowflake/CHANGELOG.rst
@@ -73,6 +73,12 @@ However in this case the result returned by ``execute`` method is unchanged (it
 rather than sequences and those dictionaries are pushed to XCom, so your DAGs relying on this behaviour
 should continue working without any change.
 
+UPDATE: One of the unmentioned, breaking changes in the operator in 4.0 line was to switch autocommit to
+False by default. While not very friendly to the users, it was a side effect of unifying the interface
+with other SQL operators and we released it to the users, so switching it back again would cause even more
+confusion. You should manually add autocommit=True to your SnowflakeOperator if you want to continue using
+it and expect autocommit to work, but even better, you should switch to SQLExecuteQueryOperator.
+
 In SnowflakeHook, if both ``extra__snowflake__foo`` and ``foo`` existed in connection extra
 dict, the prefixed version would be used; now, the non-prefixed version will be preferred.
 
diff --git a/airflow/providers/snowflake/operators/snowflake.py b/airflow/providers/snowflake/operators/snowflake.py
index 741889511c..62e0bb0d1e 100644
--- a/airflow/providers/snowflake/operators/snowflake.py
+++ b/airflow/providers/snowflake/operators/snowflake.py
@@ -41,8 +41,6 @@ class SnowflakeOperator(SQLExecuteQueryOperator):
     :param sql: the SQL code to be executed as a single string, or
         a list of str (sql statements), or a reference to a template file.
         Template references are recognized by str ending in '.sql'
-    :param autocommit: if True, each command is automatically committed.
-        (default value: True)
     :param parameters: (optional) the parameters to render the SQL query with.
     :param warehouse: name of warehouse (will overwrite any warehouse
         defined in the connection's extra JSON)