Module Contents

class airflow.sensors.sql_sensor.SqlSensor(conn_id, sql, parameters=None, *args, **kwargs)[source]


Runs a sql statement until a criteria is met. It will keep trying while sql returns no row, or if the first cell in (0, ‘0’, ‘’).

  • conn_id (str) – The connection to run the sensor against

  • sql (str) – The sql to run. To pass, it needs to return at least one cell that contains a non-zero / empty string value.

  • parameters (mapping or iterable) – The parameters to render the SQL query with (optional).

template_fields = ['sql'][source]
template_ext = ['.hql', '.sql'][source]
ui_color = #7c7287[source]
poke(self, context)[source]