Skip to content

Commit

Permalink
Add deprecation warning in core provider
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Jan 22, 2024
1 parent 6b3971a commit 702f7c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions astronomer/providers/core/triggers/external_task.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
import datetime
import typing
import warnings
from typing import Any, AsyncIterator, Dict, List, Tuple

from airflow import AirflowException
Expand Down Expand Up @@ -105,6 +106,15 @@ def __init__(
execution_dates: List[datetime.datetime],
poll_interval: float = 5.0,
):
warnings.warn(
(
"This module is deprecated and will be removed in airflow>=2.9.0"
"Please use `airflow.triggers.external_task.WorkflowTrigger` "
"and set deferrable to True instead."
),
DeprecationWarning,
stacklevel=2,
)
super().__init__()
self.dag_id = dag_id
self.states = states
Expand Down
10 changes: 10 additions & 0 deletions astronomer/providers/core/triggers/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime
import os
import typing
import warnings
from glob import glob
from typing import Any, Dict, Tuple

Expand All @@ -26,6 +27,15 @@ def __init__(
recursive: bool = False,
poll_interval: float = 5.0,
):
warnings.warn(
(
"This module is deprecated and will be removed in airflow>=2.9.0"
"Please use `airflow.triggers.file.FileTrigger` "
"and set deferrable to True instead."
),
DeprecationWarning,
stacklevel=2,
)
super().__init__()
self.filepath = filepath
self.recursive = recursive
Expand Down

0 comments on commit 702f7c9

Please sign in to comment.