sqlmesh.dbt.util API documentation

Edit on GitHub

# sqlmesh.dbt.util

View Source

     1import agate
     2import pandas as pd
     3
     4
     5def pandas_to_agate(df: pd.DataFrame) -> agate.Table:
     6    """
     7    Converts a Pandas DataFrame to an Agate Table
     8    """
     9    from dbt.clients.agate_helper import table_from_data
    10
    11    return table_from_data(df.to_dict(orient="records"), df.columns.tolist())

def pandas_to_agate(df: pandas.core.frame.DataFrame) -> agate.table.Table: View Source

     6def pandas_to_agate(df: pd.DataFrame) -> agate.Table:
     7    """
     8    Converts a Pandas DataFrame to an Agate Table
     9    """
    10    from dbt.clients.agate_helper import table_from_data
    11
    12    return table_from_data(df.to_dict(orient="records"), df.columns.tolist())

Converts a Pandas DataFrame to an Agate Table