m

    Marcin Grzybowski

    3 months ago
    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
    probably this commit introduced regression, will try to fix ithttps://github.com/PrefectHQ/prefect/commit/c72096215cf2002e68f8bcdd5a5fa7896d5c1a3b
    Anna Geller

    Anna Geller

    3 months ago
    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

    3 months ago
    Yeah, after fixing https://github.com/PrefectHQ/prefect/pull/5846 I did install snowflake for prefect and it seems to work
    Anna Geller

    Anna Geller

    3 months ago
    nice, thx for the update! 🙌