sql
Prism users can execute sql queries using the hooks.sql() function. This function takes three arguments:
- adapter_name: str: the adapter with which to run the SQL query. This should match the adapter name in- profile.yml.
- query: str: the SQL query as a string
- return_type: Optional[str]: the return type for the SQL query. The default value is- None. This simply returns the query data as a list. Other valid options include:- pandasif you want to return the data as a Pandas DataFrame
 
def run(self, tasks, hooks):
    hooks.sql(
        adapter_name="...",
        query="...",
        return_type = "pandas"
    )The configurations for these adapters need to be specified in profile.yml, and they are covered in more detail next.
Last updated
