hequn8128 commented on a change in pull request #11769:
URL: https://github.com/apache/flink/pull/11769#discussion_r411129984



##########
File path: flink-python/pyflink/table/table_environment.py
##########
@@ -1154,26 +1154,28 @@ def connect(self, connector_descriptor):
             self._j_tenv.connect(connector_descriptor._j_connector_descriptor))
 
     @staticmethod
-    def create(stream_execution_environment, table_config=None, 
environment_settings=None):
+    def create(stream_execution_environment=None, table_config=None, 
environment_settings=None):
         """
-        Creates a :class:`~pyflink.table.TableEnvironment` for a
+        Creates a :class:`~pyflink.table.StreamTableEnvironment` for a

Review comment:
       Change to
   ```
   Creates a :class:`~pyflink.table.StreamTableEnvironment`.
   ```
   since we can also create the TableEnvironment without the execution 
environment.

##########
File path: flink-python/pyflink/table/table_environment.py
##########
@@ -1154,26 +1154,28 @@ def connect(self, connector_descriptor):
             self._j_tenv.connect(connector_descriptor._j_connector_descriptor))
 
     @staticmethod
-    def create(stream_execution_environment, table_config=None, 
environment_settings=None):
+    def create(stream_execution_environment=None, table_config=None, 
environment_settings=None):
         """
-        Creates a :class:`~pyflink.table.TableEnvironment` for a
+        Creates a :class:`~pyflink.table.StreamTableEnvironment` for a
         :class:`~pyflink.datastream.StreamExecutionEnvironment`.
 
         Example:
         ::
 
+            # create with StreamExecutionEnvironment.
             >>> env = StreamExecutionEnvironment.get_execution_environment()
-            # create without optional parameters.
             >>> table_env = StreamTableEnvironment.create(env)
-            # create with TableConfig
+            # create with StreamExecutionEnvironment and TableConfig.
             >>> table_config = TableConfig()
             >>> table_config.set_null_check(False)
             >>> table_env = StreamTableEnvironment.create(env, table_config)
-            # create with EnvrionmentSettings
+            # create with StreamExecutionEnvironment and EnvironmentSettings.
             >>> environment_settings = 
EnvironmentSettings.new_instance().use_blink_planner() \\
             ...     .build()
             >>> table_env = StreamTableEnvironment.create(
             ...     env, environment_settings=environment_settings)
+            # create with EnvironmentSettings.
+            >>> table_env = 
BatchTableEnvironment.create(environment_settings=environment_settings)

Review comment:
       BatchTableEnvironment => StreamTableEnvironment

##########
File path: flink-python/pyflink/table/table_environment.py
##########
@@ -1280,7 +1297,8 @@ def connect(self, connector_descriptor):
     @staticmethod
     def create(execution_environment=None, table_config=None, 
environment_settings=None):
         """
-        Creates a :class:`~pyflink.table.BatchTableEnvironment`.
+        Creates a :class:`~pyflink.table.BatchTableEnvironment` for a

Review comment:
       Revert the change as we can also create the TableEnvironment without the 
execution_environment.




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

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


Reply via email to