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/06 07:27:27 UTC

[GitHub] [flink] Vancior opened a new pull request, #19883: [FLINK-27901][python] support TableEnvironment.create(configuration)

Vancior opened a new pull request, #19883:
URL: https://github.com/apache/flink/pull/19883

   
   ## What is the purpose of the change
   
   This PR support `TableEnvironment.create(Configuration)` API in PyFlink, which is an alignment to Java API.
   
   ## Verifying this change
   
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (Python generated doc)
   


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


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

Posted by GitBox <gi...@apache.org>.
dianfu commented on code in PR #19883:
URL: https://github.com/apache/flink/pull/19883#discussion_r890690352


##########
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':

Review Comment:
   Also update the documentation in https://nightlies.apache.org/flink/flink-docs-master/docs/dev/python/python_config/.



##########
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':

Review Comment:
   This will break backward compatibility. Users may write code as following `TableEnvironment.create(environment_settings=env_settings)`. What about keep the name not changed?



##########
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:
   EnvironmentSettings.from_configuration(conf_or_settings)



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


[GitHub] [flink] dianfu closed pull request #19883: [FLINK-27901][python] support TableEnvironment.create(configuration)

Posted by GitBox <gi...@apache.org>.
dianfu closed pull request #19883: [FLINK-27901][python] support TableEnvironment.create(configuration)
URL: https://github.com/apache/flink/pull/19883


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


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

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #19883:
URL: https://github.com/apache/flink/pull/19883#issuecomment-1147140758

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a9672ee79a5683cba0112d7b5ca79874c5be34d5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a9672ee79a5683cba0112d7b5ca79874c5be34d5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a9672ee79a5683cba0112d7b5ca79874c5be34d5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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


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

Posted by GitBox <gi...@apache.org>.
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