This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6ba2658aef Util helper deprecated functions removal (#41520)
6ba2658aef is described below
commit 6ba2658aef1ed457f42188203fc9948cf5ae54c0
Author: Gopal Dirisala <[email protected]>
AuthorDate: Fri Aug 16 19:20:23 2024 +0530
Util helper deprecated functions removal (#41520)
* util helper depreaction removal
* Tame Mypy
* news fragment added
---------
Co-authored-by: Tzu-ping Chung <[email protected]>
---
airflow/utils/helpers.py | 24 +---------------------
newsfragments/41520.significant.rst | 5 +++++
.../aws/example_bedrock_retrieve_and_generate.py | 6 +++---
3 files changed, 9 insertions(+), 26 deletions(-)
diff --git a/airflow/utils/helpers.py b/airflow/utils/helpers.py
index 801cda03f0..8c08acc66b 100644
--- a/airflow/utils/helpers.py
+++ b/airflow/utils/helpers.py
@@ -21,7 +21,6 @@ import copy
import itertools
import re
import signal
-import warnings
from datetime import datetime
from functools import reduce
from typing import TYPE_CHECKING, Any, Callable, Generator, Iterable, Mapping,
MutableMapping, TypeVar, cast
@@ -29,8 +28,7 @@ from typing import TYPE_CHECKING, Any, Callable, Generator,
Iterable, Mapping, M
from lazy_object_proxy import Proxy
from airflow.configuration import conf
-from airflow.exceptions import AirflowException, RemovedInAirflow3Warning
-from airflow.utils.module_loading import import_string
+from airflow.exceptions import AirflowException
from airflow.utils.types import NOTSET
if TYPE_CHECKING:
@@ -231,26 +229,6 @@ def partition(pred: Callable[[T], bool], iterable:
Iterable[T]) -> tuple[Iterabl
return itertools.filterfalse(pred, iter_1), filter(pred, iter_2)
-def chain(*args, **kwargs):
- """Use `airflow.models.baseoperator.chain`, this function is deprecated."""
- warnings.warn(
- "This function is deprecated. Please use
`airflow.models.baseoperator.chain`.",
- RemovedInAirflow3Warning,
- stacklevel=2,
- )
- return import_string("airflow.models.baseoperator.chain")(*args, **kwargs)
-
-
-def cross_downstream(*args, **kwargs):
- """Use `airflow.models.baseoperator.cross_downstream`, this function is
deprecated."""
- warnings.warn(
- "This function is deprecated. Please use
`airflow.models.baseoperator.cross_downstream`.",
- RemovedInAirflow3Warning,
- stacklevel=2,
- )
- return
import_string("airflow.models.baseoperator.cross_downstream")(*args, **kwargs)
-
-
def build_airflow_url_with_query(query: dict[str, Any]) -> str:
"""
Build airflow url using base_url and default_view and provided query.
diff --git a/newsfragments/41520.significant.rst
b/newsfragments/41520.significant.rst
new file mode 100644
index 0000000000..6f5c605da5
--- /dev/null
+++ b/newsfragments/41520.significant.rst
@@ -0,0 +1,5 @@
+Removed deprecated methods in airflow/utils/helpers.py
+
+ Methods removed:
+ * chain (Use ``airflow.models.baseoperator.chain``)
+ * cross_downstream (Use ``airflow.models.baseoperator.cross_downstream``)
diff --git
a/tests/system/providers/amazon/aws/example_bedrock_retrieve_and_generate.py
b/tests/system/providers/amazon/aws/example_bedrock_retrieve_and_generate.py
index fcebc8c40a..224ddc21d8 100644
--- a/tests/system/providers/amazon/aws/example_bedrock_retrieve_and_generate.py
+++ b/tests/system/providers/amazon/aws/example_bedrock_retrieve_and_generate.py
@@ -35,6 +35,7 @@ from opensearchpy import (
from airflow import DAG
from airflow.decorators import task, task_group
+from airflow.models.baseoperator import chain
from airflow.operators.empty import EmptyOperator
from airflow.providers.amazon.aws.hooks.bedrock import BedrockAgentHook
from airflow.providers.amazon.aws.hooks.opensearch_serverless import
OpenSearchServerlessHook
@@ -58,7 +59,6 @@ from
airflow.providers.amazon.aws.sensors.opensearch_serverless import (
)
from airflow.providers.amazon.aws.utils import get_botocore_version
from airflow.utils.edgemodifier import Label
-from airflow.utils.helpers import chain
from airflow.utils.trigger_rule import TriggerRule
from tests.system.providers.amazon.aws.utils import SystemTestContextBuilder
@@ -450,7 +450,7 @@ with DAG(
create_bucket = S3CreateBucketOperator(task_id="create_bucket",
bucket_name=bucket_name)
- create_opensearch_policies = create_opensearch_policies(
+ opensearch_policies = create_opensearch_policies(
bedrock_role_arn=test_context[ROLE_ARN_KEY],
collection_name=vector_store_name,
policy_name_suffix=env_id,
@@ -563,7 +563,7 @@ with DAG(
# TEST SETUP
test_context,
create_bucket,
- create_opensearch_policies,
+ opensearch_policies,
collection,
await_collection,
create_vector_index(index_name=index_name, collection_id=collection,
region=region_name),