This is an automated email from the ASF dual-hosted git repository.

vterentev pushed a commit to branch revert-36772
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/revert-36772 by this push:
     new e37bfe44f14 Revert #36772
e37bfe44f14 is described below

commit e37bfe44f147a80f83471b82b70c624e31a18182
Author: Vitaly Terentyev <[email protected]>
AuthorDate: Mon Dec 8 17:42:23 2025 +0400

    Revert #36772
---
 sdks/python/apache_beam/io/requestresponse.py | 11 +----------
 sdks/python/setup.py                          |  2 +-
 sdks/python/tox.ini                           |  4 ++--
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/sdks/python/apache_beam/io/requestresponse.py 
b/sdks/python/apache_beam/io/requestresponse.py
index e53fa07471a..213a1a3fc7e 100644
--- a/sdks/python/apache_beam/io/requestresponse.py
+++ b/sdks/python/apache_beam/io/requestresponse.py
@@ -35,6 +35,7 @@ from typing import Tuple
 from typing import TypeVar
 from typing import Union
 
+import redis
 from google.api_core.exceptions import TooManyRequests
 
 import apache_beam as beam
@@ -45,11 +46,6 @@ from apache_beam.metrics import Metrics
 from apache_beam.transforms.util import BatchElements
 from apache_beam.utils import retry
 
-try:
-  import redis
-except ImportError:
-  redis = None
-
 RequestT = TypeVar('RequestT')
 ResponseT = TypeVar('ResponseT')
 
@@ -693,11 +689,6 @@ class RedisCache(Cache):
     self._kwargs = kwargs if kwargs else {}
     self._source_caller = None
 
-    if redis is None:
-      raise ImportError(
-          'Failed to import redis. You can ensure it is '
-          'installed by installing the redis beam extra')
-
   def get_read(self):
     """get_read returns a PTransform for reading from the cache."""
     ensure_coders_exist(self._request_coder)
diff --git a/sdks/python/setup.py b/sdks/python/setup.py
index 176c84c9966..677090b04eb 100644
--- a/sdks/python/setup.py
+++ b/sdks/python/setup.py
@@ -401,6 +401,7 @@ if __name__ == '__main__':
           
'protobuf>=3.20.3,<7.0.0.dev0,!=4.0.*,!=4.21.*,!=4.22.0,!=4.23.*,!=4.24.*',  # 
pylint: disable=line-too-long
           'python-dateutil>=2.8.0,<3',
           'pytz>=2018.3',
+          'redis>=5.0.0,<6',
           'requests>=2.32.4,<3.0.0',
           'sortedcontainers>=2.4.0',
           'typing-extensions>=3.7.0',
@@ -590,7 +591,6 @@ if __name__ == '__main__':
               'torch==2.8.0+cpu',
               'transformers>=4.28.0,<4.56.0'
           ],
-          'redis': ['redis>=5.0.0,<6'],
           'tft': [
               'tensorflow_transform>=1.14.0,<1.15.0'
               # tensorflow-transform requires dill, but doesn't set dill as a
diff --git a/sdks/python/tox.ini b/sdks/python/tox.ini
index 52fd82d4115..e7707279194 100644
--- a/sdks/python/tox.ini
+++ b/sdks/python/tox.ini
@@ -33,7 +33,7 @@ pip_pre = True
 # allow apps that support color to use it.
 passenv=TERM,CLOUDSDK_CONFIG,DOCKER_*,TESTCONTAINERS_*,TC_*,ALLOYDB_PASSWORD
 # Set [] options for pip installation of apache-beam tarball.
-extras = test,dataframe,hadoop,redis,tfrecord,yaml
+extras = test,dataframe,hadoop,tfrecord,yaml
 # Don't warn that these commands aren't installed.
 allowlist_externals =
   false
@@ -173,7 +173,7 @@ setenv =
   TC_SLEEP_TIME = {env:TC_SLEEP_TIME:1}
 
 # NOTE: we could add ml_test to increase the collected code coverage metrics, 
but it would make the suite slower.
-extras = test,hadoop,gcp,interactive,dataframe,aws,redis
+extras = test,hadoop,gcp,interactive,dataframe,aws
 commands =
   bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}" 
"--cov-report=xml --cov=. --cov-append"
 

Reply via email to