Session class is the main entry point for all Fenic DataFrame operations. It manages configuration, execution backends, and resource lifecycle. Similar to PySpark’s SparkSession.
Creating a Session
get_or_create
Configuration object specifying session settings including:
app_name: Name of the applicationcloud: Whether to use cloud execution backendapi_key: API key for cloud execution (required when cloud=True)
A Session instance configured with the provided settings
Direct construction using
Session() is not allowed. Always use Session.get_or_create().Properties
read
DataFrameReader that can be used to read data as a DataFrame.
A reader interface to read data into DataFrame from various sources (CSV, Parquet, JSON, etc.)
catalog
Catalog interface for managing tables and views
Core Methods
create_dataframe
Input data. Must be one of:
- Polars DataFrame
- Pandas DataFrame
- dict of column_name → list of values
- list of dicts (each dict representing a row)
- pyarrow Table
A new DataFrame instance
table
Name of the table to load
Table as a DataFrame
view
Name of the view to load
View as a DataFrame
sql
A SQL query string with placeholders like
{df}Keyword arguments mapping placeholder names to DataFrames
A lazy DataFrame representing the result of the SQL query
For supported SQL syntax and functions, refer to the DuckDB SQL documentation.
stop
Whether to skip printing the usage summary
Unless
skip_usage_summary is set, a summary of your session’s metrics will print when you stop your session.Aliases
createDataFrame→create_dataframegetOrCreate→get_or_create
