You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/11 07:12:37 UTC

[GitHub] [flink] deadwind4 commented on a diff in pull request #19685: [FLINK-27297][python] Add get_execution_environment method with configuration argument.

deadwind4 commented on code in PR #19685:
URL: https://github.com/apache/flink/pull/19685#discussion_r869946982


##########
flink-python/pyflink/datastream/stream_execution_environment.py:
##########
@@ -807,17 +807,30 @@ def register_cached_file(self, file_path: str, name: str, executable: bool = Fal
         self._j_stream_execution_environment.registerCachedFile(file_path, name, executable)
 
     @staticmethod
-    def get_execution_environment() -> 'StreamExecutionEnvironment':
+    def get_execution_environment(configuration: Configuration = None) \
+            -> 'StreamExecutionEnvironment':
         """
         Creates an execution environment that represents the context in which the
         program is currently executed. If the program is invoked standalone, this
         method returns a local execution environment.
 
+        When executed from the command line the given configuration is stacked on top of the
+        global configuration which comes from the flink-conf.yaml, potentially overriding
+        duplicated options.
+
+        :param configuration: The configuration to instantiate the environment with.
         :return: The execution environment of the context in which the program is executed.
         """
         gateway = get_gateway()
-        j_stream_exection_environment = gateway.jvm.org.apache.flink.streaming.api.environment\
-            .StreamExecutionEnvironment.getExecutionEnvironment()
+        JStreamExecutionEnvironment = gateway.jvm.org.apache.flink.streaming.api.environment \
+            .StreamExecutionEnvironment
+
+        if configuration:
+            j_stream_exection_environment = JStreamExecutionEnvironment.getExecutionEnvironment()

Review Comment:
   I find the only one [test_table_environment_api.py](https://github.com/apache/flink/pull/19685/files#diff-51b6ef54d67d0bdb98ffaac4535b82acdce2c0e591164a7018350aeda663ecb3) can be updated



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org