# Snowflake Tasks


This module contains a collection of tasks for interacting with snowflake databases via the snowflake-connector-python library.

# SnowflakeQuery

class

prefect.tasks.snowflake.snowflake.SnowflakeQuery

(account, user, password=None, private_key=None, database=None, schema=None, role=None, warehouse=None, query=None, data=None, autocommit=None, **kwargs)[source]

Task for executing a query against a snowflake database.

Args:

  • account (str): snowflake account name, see snowflake connector package documentation for details
  • user (str): user name used to authenticate
  • password (str, optional): password used to authenticate. password or private_lkey must be present
  • private_key (bytes, optional): pem to authenticate. password or private_key must be present
  • database (str, optional): name of the default database to use
  • schema (int, optional): name of the default schema to use
  • role (str, optional): name of the default role to use
  • warehouse (str, optional): name of the default warehouse to use
  • query (str, optional): query to execute against database
  • data (tuple, optional): values to use in query, must be specified using placeholder is query string
  • autocommit (bool, optional): set to True to autocommit, defaults to None, which takes snowflake AUTOCOMMIT parameter
  • **kwargs (dict, optional): additional keyword arguments to pass to the Task constructor

methods:                                                                                                                                                       

prefect.tasks.snowflake.snowflake.SnowflakeQuery.run

(query=None, data=None, autocommit=None)[source]

Task run method. Executes a query against snowflake database.

Args:

  • query (str, optional): query to execute against database
  • data (tuple, optional): values to use in query, must be specified using placeholder is query string
  • autocommit (bool, optional): set to True to autocommit, defaults to None which takes the snowflake AUTOCOMMIT parameter
Returns:
  • None
Raises:
  • ValueError: if query parameter is None or a blank string
  • DatabaseError: if exception occurs when executing the query



This documentation was auto-generated from commit n/a
on July 1, 2021 at 18:35 UTC