I'm trying to query our Snowflake database and fol...
# ask-community
s
I'm trying to query our Snowflake database and following this documentation. I identically followed the documentation and can't see the query being passed to the database on the Snowflake side. Code in thread 🧵
Copy code
def table(snowflake: SnowflakeResource) -> pd.DataFrame:
    with snowflake.get_connection() as conn:
        return (
            conn.cursor()
            .execute(
                "SELECT * FROM OPEN_WEATHER"
            )
            .fetch_pandas_all()
        )

defs = Definitions(
    resources={
        "snowflake": SnowflakeResource(
            account=EnvVar("SNOWFLAKE_ACCOUNT"),
            user=EnvVar("SNOWFLAKE_USER"),
            password=EnvVar("SNOWFLAKE_PASSWORD"),
            database="PROD",
            schema="RAW",
        )
    },
)
t
Hi! What feedback are you getting from Python? Is the run hanging, failing, oddly working, etc.?
s
Oddly working, but I don't see the sql statement passing to the database on the snowflake side.
t
Oh hmm. I see you're not specifying the role, what could be happening is that it's executing with a default role that is higher than the one you're viewing the query history in (ex. ACCOUNTADAMIN)