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/06/07 02:57:00 UTC

[GitHub] [flink] Vancior commented on a diff in pull request #19883: [FLINK-27901][python] support TableEnvironment.create(configuration)

Vancior commented on code in PR #19883:
URL: https://github.com/apache/flink/pull/19883#discussion_r890721959


##########
flink-python/pyflink/table/table_environment.py:
##########
@@ -98,18 +99,25 @@ def __init__(self, j_tenv, serializer=PickleSerializer()):
         self._open()
 
     @staticmethod
-    def create(environment_settings: EnvironmentSettings) -> 'TableEnvironment':
+    def create(conf_or_settings: Union[EnvironmentSettings, Configuration]) -> 'TableEnvironment':
         """
         Creates a table environment that is the entry point and central context for creating Table
         and SQL API programs.
 
-        :param environment_settings: The environment settings used to instantiate the
+        :param conf_or_settings: The configuration or environment settings used to instantiate the
                                      :class:`~pyflink.table.TableEnvironment`.
         :return: The :class:`~pyflink.table.TableEnvironment`.
         """
         gateway = get_gateway()
-        j_tenv = gateway.jvm.TableEnvironment.create(
-            environment_settings._j_environment_settings)
+        if isinstance(conf_or_settings, EnvironmentSettings):
+            environment_settings = conf_or_settings
+        elif isinstance(conf_or_settings, Configuration):
+            environment_settings = EnvironmentSettings.new_instance() \

Review Comment:
   `from_configuration` is deprecated



-- 
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