diff --git a/providers/src/airflow/providers/standard/sensors/filesystem.py b/providers/src/airflow/providers/standard/sensors/filesystem.py index 6bf7452e59666..650787c485e65 100644 --- a/providers/src/airflow/providers/standard/sensors/filesystem.py +++ b/providers/src/airflow/providers/standard/sensors/filesystem.py @@ -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 @@ -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