I was wondering if this is how tables/df's names a...
# general
e
I was wondering if this is how tables/df's names are defined for sql. I am looking to implement generic accessor methods for my classes, since sql templates can be really flexible.
Copy code
def get(df: daft.DataFrame, columns: List[str], where: Dict[str, str]):
        columns_str = ", ".join(columns)
        where_str = " AND ".join([f"{key} = '{value}'" for key, value in where.items()])
        return df.sql(f"SELECT {columns_str} FROM {df.__name__} WHERE {where_str}")
j
Hahaha sounds like you’d just want to use the DataFrame/Expression API here though if it’s that much string templating 😛
🌊 1
🙌 1