OpenLineage Macros

Invoke as a jinja template, e.g.

Lineage run id

PythonOperator(
    task_id="render_template",
    python_callable=my_task_function,
    op_args=[
        "{{ macros.OpenLineageProviderPlugin.lineage_run_id(task_instance) }}"
    ],  # lineage_run_id macro invoked
    provide_context=False,
    dag=dag,
)

Lineage parent id

PythonOperator(
    task_id="render_template",
    python_callable=my_task_function,
    op_args=[
        "{{ macros.OpenLineageProviderPlugin.lineage_parent_id(run_id, task_instance) }}"
    ],  # macro invoked
    provide_context=False,
    dag=dag,
)

Was this entry helpful?