astronomer.providers.snowflake.operators.snowflake

Module Contents

Classes

SnowflakeOperatorAsync

Executes SQL code in a Snowflake database

class astronomer.providers.snowflake.operators.snowflake.SnowflakeOperatorAsync(*, poll_interval=5, **kwargs)[source]

Bases: airflow.providers.snowflake.operators.snowflake.SnowflakeOperator

Executes SQL code in a Snowflake database

Parameters
  • snowflake_conn_id – Reference to Snowflake connection id

  • sql – the sql code to be executed. (templated)

  • autocommit – if True, each command is automatically committed. (default value: True)

  • parameters – (optional) the parameters to render the SQL query with.

  • warehouse – name of warehouse (will overwrite any warehouse defined in the connection’s extra JSON)

  • database – name of database (will overwrite database defined in connection)

  • schema – name of schema (will overwrite schema defined in connection)

  • role – name of role (will overwrite any role defined in connection’s extra JSON)

  • authenticator – authenticator for Snowflake. ‘snowflake’ (default) to use the internal Snowflake authenticator ‘externalbrowser’ to authenticate using your web browser and Okta, ADFS or any other SAML 2.0-compliant identify provider (IdP) that has been defined for your account ‘https://<your_okta_account_name>.okta.com’ to authenticate through native Okta.

  • session_parameters – You can set session-level parameters at the time you connect to Snowflake

  • poll_interval (int) – the interval in seconds to poll the query

get_db_hook(self)[source]

Get the Snowflake Hook

execute(self, context)[source]

Make a sync connection to snowflake and run query in execute_async function in snowflake and close the connection and with the query ids, fetch the status of the query. By deferring the SnowflakeTrigger class pass along with query ids.

execute_complete(self, context, event=None)[source]

Callback for when the trigger fires - returns immediately. Relies on trigger to throw an exception, otherwise it assumes execution was successful.