airflow.contrib.sensors.bash_sensor

Module Contents

class airflow.contrib.sensors.bash_sensor.BashSensor(bash_command, env=None, output_encoding='utf-8', *args, **kwargs)[source]

Bases:airflow.sensors.base_sensor_operator.BaseSensorOperator

Executes a bash command/script and returns True if and only if the return code is 0.

Parameters
  • bash_command (str) – The command, set of commands or reference to a bash script (must be ‘.sh’) to be executed.

  • env (dict) – If env is not None, it must be a mapping that defines the environment variables for the new process; these are used instead of inheriting the current process environment, which is the default behavior. (templated)

  • output_encoding (str) – output encoding of bash command.

template_fields = ['bash_command', 'env'][source]
poke(self, context)[source]

Execute the bash command in a temporary directory which will be cleaned afterwards