Registry /
data / acryl-datahub-airflow-plugin
Install & Compatibility
Where this runs
tested against v1.7.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 40.0s · import 0.000s · 451MB
443MB installed
● package 443MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
get_provider_info
✓ from datahub_airflow_plugin import get_provider_info
✗ from datahub_airflow_plugin.operators.lineage import prepare_lineage, apply_lineage
This quickstart demonstrates a basic Airflow DAG. Once the `acryl-datahub-airflow-plugin` is installed and a 'DataHub REST Server' connection named `datahub_rest_default` is configured in Airflow, the plugin automatically extracts metadata and lineage for supported operators (like SQL operators or those using native Airflow Datasets/Assets) without explicit Python imports in the DAG code. For custom operators, you might need to use `inlets` and `outlets` or `prepare_lineage`/`apply_lineage` decorators. Ensure your DataHub GMS host is accessible from Airflow.
import os
from airflow import DAG
from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperator
from airflow.operators.bash import BashOperator
from datetime import datetime
# Ensure DataHub REST connection is configured in Airflow UI or via CLI:
# airflow connections add --conn-type 'datahub-rest' 'datahub_rest_default' --conn-host 'http://datahub-gms:8080' --conn-password "$DATAHUB_AUTH_TOKEN"
with DAG(
dag_id='datahub_example_dag',
start_date=datetime(2023, 1, 1),
schedule_interval=None,
catchup=False,
tags=['datahub', 'lineage', 'example'],
) as dag:
start_task = BashOperator(
task_id='start_task',
bash_command='echo "Starting DAG"',
)
# Example of a task that would automatically get lineage if it's a supported SQL operator
# (e.g., PostgresOperator, BigQueryInsertJobOperator, etc., not shown here for brevity).
# The plugin automatically extracts lineage based on OpenLineage events.
process_data_task = BashOperator(
task_id='process_data_task',
bash_command='echo "Processing data..." && sleep 5',
# For manual lineage, you can use inlets/outlets attributes (table-level only)
# inlets={'datasets': [{'platform': 'postgres', 'name': 'mydb.public.source_table'}]},
# outlets={'datasets': [{'platform': 'postgres', 'name': 'mydb.public.target_table'}]},
)
end_task = BashOperator(
task_id='end_task',
bash_command='echo "DAG finished"',
)
start_task >> process_data_task >> end_task
datahub --version
Debug
Known issues
breakingPython 3.9 support has been dropped; all `acryl-datahub` modules, including the Airflow plugin, now require Python 3.10 or later. Upgrade Python before upgrading the plugin.fixUpgrade your Python environment to 3.10 or newer.
affects: <=1.3.x
breakingThe `acryl-datahub-airflow-plugin` has dropped support for Airflow versions less than 2.7. Users on older Airflow versions must upgrade Airflow or pin to an older plugin version.fixUpgrade Airflow to version 2.7+ (or 3.1+ for Airflow 3.x).
affects: <=1.3.x
breakingThe v1 plugin (`DATAHUB_AIRFLOW_PLUGIN_USE_V1_PLUGIN=true`) has been removed. The v2 plugin is now the default. Users explicitly setting `DATAHUB_AIRFLOW_PLUGIN_USE_V1_PLUGIN=true` must upgrade or pin to an older plugin version.fixRemove `DATAHUB_AIRFLOW_PLUGIN_USE_V1_PLUGIN=true` configuration. The v2 plugin is now default.
affects: >=1.4.0.0
breakingThe latest DataHub Airflow plugin is not compatible with Airflow 3.2+ due to a deprecated import `airflow.models.mappedoperator`, causing `ModuleNotFoundError`.fixDowngrade Airflow to 3.1.x or await a plugin update that addresses Airflow 3.2+ compatibility.
affects: >=1.5.0.0
gotchaAirflow 3.0.6 pins `pydantic==2.11.7`, which contains a bug preventing the DataHub plugin from importing correctly. This issue is resolved in Airflow 3.1.0+ (which uses `pydantic>=2.11.8`).fixUpgrade Airflow to 3.1.0 or later, or manually upgrade `pydantic` to `>=2.11.8` (may cause dependency conflicts).
affects: All versions with Airflow 3.0.6
gotchaThe 'kill switch' to disable the plugin differs between Airflow versions. For Airflow 2.x, use an Airflow Variable `datahub_airflow_plugin_disable_listener` set to `true`. For Airflow 3.x, use the environment variable `AIRFLOW_VAR_DATAHUB_AIRFLOW_PLUGIN_DISABLE_LISTENER=true`.fixUse the appropriate method (Airflow Variable for 2.x, environment variable for 3.x) to disable the plugin.
affects: All versions
gotchaErrors like 'Unable to emit metadata to DataHub GMS' often stem from incorrect URL encoding in the Airflow DataHub connection string, specifically for the `/api/gms` path. Airflow may not correctly interpret unencoded slashes in connection hosts.fixURL-encode the host portion of your Airflow connection string. For example, `http://datahub-gms:8080/api/gms` should be `datahub-rest://datahub-gms:8080%2Fapi%2Fgms` (or if your host *includes* the path, `my-datahub-host.net%2Fapi%2Fgms`).
affects: All versions
Upgrade
Version history
1.7.0.7latest on PyPI · released Aug 26, 2026
Audit
Dependencies
acryl-datahubrequiredCore DataHub SDK and REST emitter, installed via extra 'sql-parser,datahub-rest'.
pydanticrequiredRequired for data validation. Minimum version >=2.4.0.
apache-airflowrequiredRequired for Airflow integration. Supports versions 2.7+ and 3.1+.
openlineage-airflowoptionalLegacy OpenLineage package for Airflow 2.x, installed via `[airflow2]` extra.
apache-airflow-providers-openlineageoptionalNative OpenLineage provider for Airflow 3.x or 2.7+, installed via `[airflow3]` extra.