You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/08/12 14:56:52 UTC

[airflow] 01/04: Add Snowflake support to SQL operator and sensor (#9843)

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

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit ff4baf67a81982af0333b3788b0781e17a9d9149
Author: Andy <an...@gmail.com>
AuthorDate: Fri Jul 17 02:04:14 2020 -0500

    Add Snowflake support to SQL operator and sensor (#9843)
    
    * Add Snowflake support to SQL operator and sensor
    * Add test for conn_type to valid hook mapping
    * Improve code quality for conn type mapping test
    
    (cherry picked from commit 9c68e7cc6fc1bf7c5a9a0156a2f0cf166cf2dfbe)
---
 airflow/operators/sql.py      | 1 +
 airflow/sensors/sql_sensor.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/operators/sql.py b/airflow/operators/sql.py
index 1e5b090..57083d2 100644
--- a/airflow/operators/sql.py
+++ b/airflow/operators/sql.py
@@ -33,6 +33,7 @@ ALLOWED_CONN_TYPE = {
     "oracle",
     "postgres",
     "presto",
+    "snowflake",
     "sqlite",
     "vertica",
 }
diff --git a/airflow/sensors/sql_sensor.py b/airflow/sensors/sql_sensor.py
index 54b2982..47a375c 100644
--- a/airflow/sensors/sql_sensor.py
+++ b/airflow/sensors/sql_sensor.py
@@ -77,7 +77,7 @@ class SqlSensor(BaseSensorOperator):
 
         allowed_conn_type = {'google_cloud_platform', 'jdbc', 'mssql',
                              'mysql', 'oracle', 'postgres',
-                             'presto', 'sqlite', 'vertica'}
+                             'presto', 'snowflake', 'sqlite', 'vertica'}
         if conn.conn_type not in allowed_conn_type:
             raise AirflowException("The connection type is not supported by SqlSensor. " +
                                    "Supported connection types: {}".format(list(allowed_conn_type)))