e

    Ellie Redding

    2 months ago
    Second question:
    snowflake_multiquery
    was throwing
    Object of type SecretStr is not JSON serializable
    errors from this line of code in the connector, where it dumps the request body, including connection auth info, into the request. I got around this for now by changing the password here from type
    SecretStr
    to
    str
    , but that’s obviously not a great solution đŸ˜… Has anyone else run into this issue?
    Kevin Kho

    Kevin Kho

    2 months ago
    Can you show me the syntax? Did you use the block? Maybe you have to get the value?
    e

    Ellie Redding

    2 months ago
    yep, it’s like this:
    from prefect_snowflake import SnowflakeCredentials
    from prefect_snowflake.database import snowflake_multiquery
    
    @flow(name="my-flow")
    def sync_to_snowflake():
      ...
      credentials = SnowflakeCredentials(
        account=config['account'],
        user=config['user'],
        password=config['password'],
        database=config['db'],
        warehouse=config['wh']
      )
      for table in tables:
        queries = build_queries(table)
        snowflake_multiquery(queries, credentials)