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

zhuzh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 17b82a7662c76dc9f41125782ba5232bb1a7eea4
Author: JunRuiLee <jrlee....@gmail.com>
AuthorDate: Mon Dec 4 11:52:55 2023 +0800

    [FLINK-33581][python] Deprecate getter/setter methods related in the 
RestartStrategy in python flink.
---
 flink-python/pyflink/common/execution_config.py                 | 7 +++++++
 flink-python/pyflink/datastream/stream_execution_environment.py | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/flink-python/pyflink/common/execution_config.py 
b/flink-python/pyflink/common/execution_config.py
index 4e7ceae37a4..fd42550c518 100644
--- a/flink-python/pyflink/common/execution_config.py
+++ b/flink-python/pyflink/common/execution_config.py
@@ -263,7 +263,14 @@ class ExecutionConfig(object):
         The restart strategy configurations are all created from 
:class:`RestartStrategies`.
 
         :param restart_strategy_configuration: Configuration defining the 
restart strategy to use.
+
+        .. note:: Deprecated since version 1.19: This method is deprecated and 
will be removed in
+                  future FLINK major version. Use 
`stream_execution_environment.configure` method
+                  instead to set the restart strategy.
         """
+        warnings.warn("Deprecated since version 1.19: This method is 
deprecated and will be removed"
+                      " in future FLINK major version. Use 
`stream_execution_environment.configure`"
+                      " method instead to set the restart strategy.", 
DeprecationWarning)
         self._j_execution_config.setRestartStrategy(
             restart_strategy_configuration._j_restart_strategy_configuration)
         return self
diff --git a/flink-python/pyflink/datastream/stream_execution_environment.py 
b/flink-python/pyflink/datastream/stream_execution_environment.py
index 1c3c3f43e8b..55543c67b80 100644
--- a/flink-python/pyflink/datastream/stream_execution_environment.py
+++ b/flink-python/pyflink/datastream/stream_execution_environment.py
@@ -17,6 +17,7 @@
 
################################################################################
 import os
 import tempfile
+import warnings
 
 from typing import List, Any, Optional, cast
 
@@ -424,7 +425,14 @@ class StreamExecutionEnvironment(object):
 
         :param restart_strategy_configuration: Restart strategy configuration 
to be set.
         :return:
+
+        .. note:: Deprecated since version 1.19: This method is deprecated and 
will be removed in
+                  future FLINK major version. Use 
`stream_execution_environment.configure` method
+                  instead to set the restart strategy.
         """
+        warnings.warn("Deprecated since version 1.19: This method is 
deprecated and will be removed"
+                      " in future FLINK major version. Use 
`stream_execution_environment.configure`"
+                      " method instead to set the restart strategy.", 
DeprecationWarning)
         self._j_stream_execution_environment.setRestartStrategy(
             restart_strategy_configuration._j_restart_strategy_configuration)
 

Reply via email to