The page you navigated to () does not exist, so we brought you to the closest page to it.
You have switched from the to the variant of this site. There is no equivalent of . We have taken you to the closest page in the variant.
Airflow connector example usage
Once you have a Union account, install union:
pip install unionExport the following environment variable to build and push images to your own container registry:
# replace with your registry name
export IMAGE_SPEC_REGISTRY="<your-container-registry>"Then run the following commands to run the workflow:
$ git clone https://github.com/unionai/unionai-examples
$ cd unionai-examples
$ union run --remote <path/to/file.py> <workflow_name> <params>The source code for this example can be found here.
from airflow.operators.bash import BashOperator
from airflow.sensors.filesystem import FileSensor
import union
@union.task
def t1():
print("success")Use the Airflow FileSensor to wait for a file to appear before running the task.
@union.workflow
def file_sensor():
sensor = FileSensor(task_id="id", filepath="/tmp/1234")
sensor >> t1()Use the Airflow BashOperator to run a bash command.
@union.workflow
def bash_sensor():
op = BashOperator(task_id="airflow_bash_operator", bash_command="echo hello")
op >> t1()