mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-25 09:00:50 +00:00
feat(ingest/airflow): allow plugin to load on listener exception (#10152)
This commit is contained in:
parent
4e328c38a7
commit
32a2de4dfc
2
.github/workflows/airflow-plugin.yml
vendored
2
.github/workflows/airflow-plugin.yml
vendored
@ -67,7 +67,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: ./metadata-ingestion/scripts/install_deps.sh
|
||||
- name: Install airflow package and test (extras ${{ matrix.extra_pip_requirements }})
|
||||
run: ./gradlew -Pextra_pip_requirements='${{ matrix.extra_pip_requirements }}' -Pextra_pip_extras='${{ matrix.extra_pip_extras }}' :metadata-ingestion-modules:airflow-plugin:lint :metadata-ingestion-modules:airflow-plugin:testQuick
|
||||
run: ./gradlew -Pextra_pip_requirements='${{ matrix.extra_pip_requirements }}' -Pextra_pip_extras='${{ matrix.extra_pip_extras }}' :metadata-ingestion-modules:airflow-plugin:build
|
||||
- name: pip freeze show list installed
|
||||
if: always()
|
||||
run: source metadata-ingestion-modules/airflow-plugin/venv/bin/activate && pip freeze
|
||||
|
@ -50,21 +50,28 @@ class DatahubPlugin(AirflowPlugin):
|
||||
name = "datahub_plugin"
|
||||
|
||||
if _USE_AIRFLOW_LISTENER_INTERFACE:
|
||||
if not NEEDS_AIRFLOW_LISTENER_MODULE:
|
||||
from datahub_airflow_plugin.datahub_listener import ( # type: ignore[misc]
|
||||
get_airflow_plugin_listener,
|
||||
try:
|
||||
if not NEEDS_AIRFLOW_LISTENER_MODULE:
|
||||
from datahub_airflow_plugin.datahub_listener import ( # type: ignore[misc]
|
||||
get_airflow_plugin_listener,
|
||||
)
|
||||
|
||||
listeners: list = list(filter(None, [get_airflow_plugin_listener()]))
|
||||
|
||||
else:
|
||||
# On Airflow < 2.5, we need the listener to be a module.
|
||||
# This is just a quick shim layer to make that work.
|
||||
#
|
||||
# Related Airflow change: https://github.com/apache/airflow/pull/27113.
|
||||
import datahub_airflow_plugin._datahub_listener_module as _listener_module # type: ignore[misc]
|
||||
|
||||
listeners = [_listener_module]
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"Failed to load the DataHub plugin's event listener: {e}",
|
||||
exc_info=True,
|
||||
)
|
||||
|
||||
listeners: list = list(filter(None, [get_airflow_plugin_listener()]))
|
||||
|
||||
else:
|
||||
# On Airflow < 2.5, we need the listener to be a module.
|
||||
# This is just a quick shim layer to make that work.
|
||||
#
|
||||
# Related Airflow change: https://github.com/apache/airflow/pull/27113.
|
||||
import datahub_airflow_plugin._datahub_listener_module as _listener_module # type: ignore[misc]
|
||||
|
||||
listeners = [_listener_module]
|
||||
listeners = []
|
||||
|
||||
|
||||
if not _USE_AIRFLOW_LISTENER_INTERFACE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user