Skip to content

Commit

Permalink
[FLINK-18507][python] Move get_config implementation to TableEnvironm…
Browse files Browse the repository at this point in the history
…ent (apache#12830)
  • Loading branch information
dianfu committed Jul 7, 2020
1 parent 4378267 commit a56d70b
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions flink-python/pyflink/table/table_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,15 +1006,17 @@ def use_database(self, database_name):
"""
self._j_tenv.useDatabase(database_name)

@abstractmethod
def get_config(self):
def get_config(self) -> TableConfig:
"""
Returns the table config to define the runtime behavior of the Table API.
:return: Current table config.
:rtype: pyflink.table.TableConfig
"""
pass
if not hasattr(self, "table_config"):
table_config = TableConfig()
table_config._j_table_config = self._j_tenv.getConfig()
setattr(self, "table_config", table_config)
return getattr(self, "table_config")

@abstractmethod
def connect(self, connector_descriptor):
Expand Down Expand Up @@ -1617,17 +1619,6 @@ def _get_j_env(self):
else:
return self._j_tenv.getPlanner().getExecutionEnvironment()

def get_config(self):
"""
Returns the table config to define the runtime behavior of the Table API.
:return: Current table config.
:rtype: pyflink.table.TableConfig
"""
table_config = TableConfig()
table_config._j_table_config = self._j_tenv.getConfig()
return table_config

def connect(self, connector_descriptor):
"""
Creates a temporary table from a descriptor.
Expand Down Expand Up @@ -1752,17 +1743,6 @@ def _get_j_env(self):
else:
return self._j_tenv.execEnv()

def get_config(self):
"""
Returns the table config to define the runtime behavior of the Table API.
:return: Current table config.
:rtype: pyflink.table.TableConfig
"""
table_config = TableConfig()
table_config._j_table_config = self._j_tenv.getConfig()
return table_config

def connect(self, connector_descriptor):
"""
Creates a temporary table from a descriptor.
Expand Down

0 comments on commit a56d70b

Please sign in to comment.