Tom Klein
12/16/2021, 2:23 AMTom Klein
12/16/2021, 2:23 AMBeginning health checks...
System Version check: OK
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/prefect/tasks/snowflake/__init__.py", line 7, in <module>
from prefect.tasks.snowflake.snowflake import (
File "/usr/local/lib/python3.7/site-packages/prefect/tasks/snowflake/snowflake.py", line 2, in <module>
import snowflake.connector as sf
ModuleNotFoundError: No module named 'snowflake'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/prefect/healthcheck.py", line 152, in <module>
flows = cloudpickle_deserialization_check(flow_file_paths)
File "/opt/prefect/healthcheck.py", line 44, in cloudpickle_deserialization_check
flows.append(cloudpickle.loads(flow_bytes))
File "/usr/local/lib/python3.7/site-packages/prefect/tasks/snowflake/__init__.py", line 14, in <module>
) from err
NameError: name 'err' is not defined
Tom Klein
12/16/2021, 2:23 AMKevin Kho
Tom Klein
12/16/2021, 2:25 AMpip install "prefect[snowflake]"
to add it (and it seemed to work)Kevin Kho
Tom Klein
12/16/2021, 2:25 AMKevin Kho
Tom Klein
12/16/2021, 2:26 AMKevin Kho
Tom Klein
12/16/2021, 2:27 AMTom Klein
12/16/2021, 2:27 AMfrom prefect.storage import Docker
from flows import xkcd, hello, seg_pred_backfill
storage = Docker(image_name='poc_multi_flow', image_tag='0.1')
storage.add_flow(xkcd.flow)
storage.add_flow(hello.flow)
storage.add_flow(seg_pred_backfill.flow)
storage = storage.build()
xkcd.flow.storage = storage
hello.flow.storage = storage
seg_pred_backfill.flow = storage
xkcd.flow.register(project_name='poc', build=False, labels=['poc'])
hello.flow.register(project_name='poc', build=False, labels=['poc'])
seg_pred_backfill.flow.register(project_name='poc', build=False, labels=['poc'])
Kevin Kho
storage = Docker(..., python_dependencies=["snowflake-connector-python"])
Tom Klein
12/16/2021, 2:32 AMseg_pred_backfill.flow = storage
is wrong and is missing a .storage
on the left-side. Fixing this didn’t resolve the snowflake dependency however.Kevin Kho
prefect["snowflake"]
, I presume on your local machine, but this won’t go into building the container. So even if this healthcheck succeeded, you would hit the error when you ran the flow but didn’t have snowflake installedTom Klein
12/16/2021, 2:38 AMKevin Kho
python_dependencies
. I’m not sure if you can or can’t. One secTom Klein
12/16/2021, 2:43 AMKevin Kho
Tom Klein
12/16/2021, 2:44 AMKevin Kho
Tom Klein
12/16/2021, 2:46 AMTom Klein
12/16/2021, 2:47 AMDocker(…, extras=['snowflake']
Tom Klein
12/16/2021, 2:47 AMTom Klein
12/16/2021, 2:47 AMbuild
only happens after all flows are added, anyway).Kevin Kho
STORAGE = Docker(python_dependencies=["pandas", '"prefect[snowflake, aws]"'])
Kevin Kho
Tom Klein
12/16/2021, 2:57 AMKevin Kho
Tom Klein
12/16/2021, 2:59 AMKevin Kho