Skip to content

Commit

Permalink
Fix Assets import along with Airflow version
Browse files Browse the repository at this point in the history
  • Loading branch information
jason810496 authored and potiuk committed Jan 2, 2025
1 parent 862c1d9 commit 7274e30
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@

from airflow.providers.common.compat.version_compat import AIRFLOW_V_2_10_PLUS, AIRFLOW_V_3_0_PLUS
from airflow.providers_manager import ProvidersManager
from airflow.sdk.definitions.asset import Asset
from airflow.utils.log.logging_mixin import LoggingMixin

if TYPE_CHECKING:
from airflow.hooks.base import BaseHook
from airflow.io.path import ObjectStoragePath
from airflow.sdk.definitions.asset import Asset

# Store context what sent lineage.
LineageContext = Union[BaseHook, ObjectStoragePath]
else:
if AIRFLOW_V_3_0_PLUS:
from airflow.sdk.definitions.asset import Asset
else:
from airflow.datasets import Dataset as Asset

_hook_lineage_collector: HookLineageCollector | None = None

Expand Down

0 comments on commit 7274e30

Please sign in to comment.