It is used to run Airflow tasks.
It is registered as an connector in the Connector Registry.
There are three kinds of Airflow tasks: AirflowOperator, AirflowSensor, and AirflowHook.
Sensor is always invoked in get method. Calling get method to check if the certain condition is met.
For example, FileSensor is used to check if the file exists. If file doesn’t exist, connector returns
RUNNING status, otherwise, it returns SUCCEEDED status.
Hook is a high-level interface to an external platform that lets you quickly and easily talk to
them without having to write low-level code that hits their API or uses special libraries. For example,
SlackHook is used to send messages to Slack. Therefore, Hooks are also invoked in get method.
Note: There is no running state for Hook. It is either successful or failed.
Operator is invoked in create method. Flytekit will always set deferrable to True for Operator. Therefore,
operator.execute will always raise TaskDeferred exception after job is submitted. In the get method,
we create a trigger to check if the job is finished.
Note: some of the operators are not deferrable. For example, BeamRunJavaPipelineOperator, BeamRunPythonPipelineOperator.
In this case, those operators will be converted to AirflowContainerTask and executed in the pod.
Return the status of the task, and return the outputs in some cases. For example, bigquery job
can’t write the structured dataset to the output location, so it returns the output literals to the propeller,
and the propeller will write the structured dataset to the blob store.