Skip to content

Commit

Permalink
fixup! fix(providers/openlineage): fix common.compat provider ImportE…
Browse files Browse the repository at this point in the history
…rror handling
  • Loading branch information
Lee-W committed Nov 16, 2024
1 parent 96d6a58 commit 7cf91bd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions providers/src/airflow/providers/openlineage/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,14 @@
try:
from airflow.providers.common.compat.assets import Asset
except ImportError:
try:
from airflow.providers.common.compat.assets import Asset
except ModuleNotFoundError:
from packaging.version import Version

from airflow import __version__ as AIRFLOW_VERSION

AIRFLOW_V_3_0_PLUS = Version(Version(AIRFLOW_VERSION).base_version) >= Version("3.0.0")
if AIRFLOW_V_3_0_PLUS:
from airflow.sdk.definitions.asset import Asset
else:
# dataset is renamed to asset since Airflow 3.0
from airflow.datasets import Dataset as Asset

Expand Down

0 comments on commit 7cf91bd

Please sign in to comment.