Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • Configuration
  • pyflink.dataframe.context.set_table_environment

pyflink.dataframe.context.set_table_environment#

set_table_environment(t_env: StreamTableEnvironment | None) → None[source]#

Set the global TableEnvironment for DataFrame operations.

This is useful in testing scenarios where you want to reuse the same TableEnvironment across multiple DataFrame creations.

Parameters:

t_env – The TableEnvironment to use globally. Pass None to reset.

Example::
>>> import pyflink.dataframe as pf
>>> # In test setup
>>> pf.set_table_environment(self.t_env)
>>> # Now from_records, from_dict will use this t_env
>>> df = pf.from_records([(1, 2)], schema=["a", "b"])
>>> # In test teardown
>>> pf.set_table_environment(None)

previous

pyflink.dataframe.context.DataFrameConfig.get

next

pyflink.dataframe.context.get_table_environment

On this page
  • set_table_environment()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.