Area: Ingestion Issues
Sub-Area: Airflow Plugin Compatibility
Applies to: OSS + Cloud
Issue
You are upgrading Apache Airflow to 3.x and want to know if the DataHub Airflow plugin works with it, which plugin version you need, and what you have to change.
Error Messages
-
RuntimeError: The DataHub Airflow v1 plugin was removed in v1.1.0.5.(you setDATAHUB_AIRFLOW_PLUGIN_USE_V1_PLUGIN=true) [datahub] datajob_url_link=taskinstance is the Airflow 2 URL format and is no longer supported by this plugin. Set datajob_url_link to 'tasks' (default) or 'grid' in airflow.cfg.
You Might Be Asking
- Does the DataHub Airflow plugin support Airflow 3.x?
- Which plugin version added Airflow 3 support?
- Does my DataHub server or DataHub Cloud version decide whether Airflow 3 works?
- Can I still use the v1 DataHub Airflow plugin with Airflow 3?
- How do I turn off the plugin on Airflow 3?
- Does column-level lineage work with Airflow 3?
Cause
Airflow 3 support lives in the acryl-datahub-airflow-plugin package that you install in your Airflow environment. Your DataHub server version, OSS or Cloud, does not turn it on or off. The plugin version is what matters.
- Plugin 1.3.1.5 is the first release that supports Airflow 3. Plugin 1.3.1.4 and earlier require Airflow below 3.
- Plugin 1.6.0.1 and later require Airflow 3.0 or later and Python 3.10 or later.
- DataHub no longer supports Airflow 2.x. Plugin fixes and new features ship only for Airflow 3. Plugin 1.6.0 is the last release that installs on Airflow 2.
The v1 plugin was removed in plugin 1.1.0.5. The current plugin is the listener based plugin, and it is the only plugin that runs on Airflow 3.
Solution
-
Upgrade Airflow to 3.0 or later. Follow the Apache Airflow upgrade guide for DAG and configuration changes on the Airflow side.
-
Install the latest plugin in your Airflow environment:
pip install 'acryl-datahub-airflow-plugin'The latest release needs no extra. If you install with an Airflow constraints file, follow Installing with Airflow constraints.
-
If you pin a plugin release from 1.3.1.5 to 1.6.0 on Airflow 3, add the
[airflow3]extra, for examplepip install 'acryl-datahub-airflow-plugin[airflow3]==1.6.0'. Without it, no OpenLineage package is installed and Airflow fails to load the plugin. -
Remove
DATAHUB_AIRFLOW_PLUGIN_USE_V1_PLUGINfrom your environment if you set it. With it set totrue, the plugin fails to load. -
If you set
datajob_url_link = taskinstancein the[datahub]section ofairflow.cfg, change it totasks(the default) orgrid. -
Set the Airflow 3 base URL so that the links from DataHub to Airflow open the right host. The plugin reads
[api] base_url(environment variableAIRFLOW__API__BASE_URL) first and falls back to[webserver] base_url. -
To turn off the plugin on Airflow 3, use one of these:
- Set
enabled = Falsein the[datahub]section ofairflow.cfg, then restart Airflow. - Set the environment variable
AIRFLOW_VAR_DATAHUB_AIRFLOW_PLUGIN_DISABLE_LISTENER=truein the Airflow environment. The listener checks this variable every time it runs and skips all work when it istrue.
Since plugin 1.3.1.8, the plugin reads only the environment variable. A Variable that you create in the Airflow UI or the Airflow database has no effect. Details are in Disabling the DataHub Plugin.
- Set
-
Run a DAG and check that the DAG, its tasks and its lineage show in DataHub. If lineage is missing, follow Missing lineage.
What the plugin does on Airflow 3
You don't need to configure these. They explain what you see.
- SQL lineage: Airflow 3 SQL operators build lineage through the OpenLineage
SQLParser. The plugin replacesSQLParser.generate_openlineage_metadata_from_sql()with DataHub's SQL parser, which gives column-level lineage. The[datahub]optionpatch_sql_parsercontrols this and defaults totrue. - Template rendering: Airflow 3 renders templates before the task runs, so the plugin does not render them again.
- Threading: the listener runs its work in a background thread by default. To turn this off, set
DATAHUB_AIRFLOW_PLUGIN_RUN_IN_THREAD=false.
If you must stay on Airflow 2 for now
Pin the plugin. An unpinned install on Airflow 2 selects a release that requires Airflow 3, so pip upgrades Airflow or the install fails. On Airflow 2.7 to 2.10, use pip install 'acryl-datahub-airflow-plugin[airflow2]<=1.6.0'. These pins are not supported and get no fixes. The pins for older Airflow versions are in Compatibility.
Related Documentation
- Airflow Integration
- Airflow Integration: Compatibility
- Airflow Integration: Disabling the DataHub Plugin
- Airflow Integration: Changelog
- Upgrading to Airflow 3
Tags: airflow, airflow-3, airflow-plugin, lineage, ingestion, upgrade, compatibility, sql-lineage, column-lineage, openlineage