Skip to main content
to_df(sql: str, sql_params: list = [], batch_size: int = 5000, sql_opts: dict = , show_progress: bool = False)[source]

Runs the given query and converts the result to a Pandas Data Frame.

Parameters

sql (str) –

The SQL query to run

sql_params (list) –

The SQL parameters that will be substituted for tokens (e.g. 11 2)

batch_size (int) –

The number of records to retrieve at a time from the database

sql_opts (dict) –

The options for SQL execution, matching the options passed to GPUdb.execute_sql(). Defaults to None.

show_progress (bool) –

Whether to display progress on the console or not. Defaults to False.

Raises

GPUdbException

Returns

pd.DataFrame –

A Pandas Data Frame containing the result set of the SQL query or None if there are no results