Skip to content

Commit

Permalink
Add import compatibility check (apache#44458)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunaljubce authored Nov 28, 2024
1 parent e9f544c commit ab2bd2d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion providers/src/airflow/providers/standard/sensors/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import datetime
import os
from collections.abc import Sequence
from dataclasses import dataclass
from functools import cached_property
from glob import glob
from typing import TYPE_CHECKING, Any
Expand All @@ -29,7 +30,21 @@
from airflow.providers.standard.hooks.filesystem import FSHook
from airflow.providers.standard.triggers.file import FileTrigger
from airflow.sensors.base import BaseSensorOperator
from airflow.triggers.base import StartTriggerArgs

try:
from airflow.triggers.base import StartTriggerArgs
except ImportError:
# TODO: Remove this when min airflow version is 2.10.0 for standard provider
@dataclass
class StartTriggerArgs: # type: ignore[no-redef]
"""Arguments required for start task execution from triggerer."""

trigger_cls: str
next_method: str
trigger_kwargs: dict[str, Any] | None = None
next_kwargs: dict[str, Any] | None = None
timeout: datetime.timedelta | None = None


if TYPE_CHECKING:
from airflow.utils.context import Context
Expand Down

0 comments on commit ab2bd2d

Please sign in to comment.