https://prefect.io logo
Title
m

Marcin Grzybowski

05/30/2022, 8:35 AM
Hello, I don't know if it's the best place for this beginner's question. I've tried to use SnowflakeQuery task and I got
NameError: name 'err' is not defined
when I run this line:
from prefect.tasks.snowflake import SnowflakeQuery
It leads me to this file
/src/prefect/tasks/snowflake/__init__.py
and this is the code from init.py that fails for me:
try:
    from prefect.tasks.snowflake.snowflake import (
        SnowflakeQuery,
        SnowflakeQueriesFromFile,
    )
except ImportError:
    raise ImportError(
        'Using `prefect.tasks.snowflake` requires Prefect to be installed with the "snowflake" extra.'
    ) from err
what am I doing wrong? Thank you
1
probably this commit introduced regression, will try to fix it https://github.com/PrefectHQ/prefect/commit/c72096215cf2002e68f8bcdd5a5fa7896d5c1a3b
a

Anna Geller

05/30/2022, 9:31 AM
this commit added a new import - seems like the root cause of the issue is you didn't install snowflake extra - can you try this?
pip install "prefect[snowflake]"
thanks for contributing a fix to this import error
m

Marcin Grzybowski

05/30/2022, 9:44 AM
Yeah, after fixing https://github.com/PrefectHQ/prefect/pull/5846 I did install snowflake for prefect and it seems to work
a

Anna Geller

05/30/2022, 9:45 AM
nice, thx for the update! 🙌