APIs
execute_sql

execute_sql Function

Summary:

The execute_sql function is used to execute an SQL query and return the result as a pandas.DataFrame. This function can either accept parameters to execute SQL directly or execute the referenced SQL cell through a RefResponse object. See the section on ref functions for more information on RefResponse objects.

Parameters:

  • sql (str, optional): the SQL query to execute.

Response:

  • pandas.DataFrame: the result of the SQL query.

Usage example:

from morphdb_utils.api import execute_sql
 
data = {
    "sample": execute_sql("select * from manhattan_air_quality")
}
 
def main(data: Dict[str, pd.DataFrame]):
    # write your code here
    return data["sample"]

Execute SQL