https://prefect.io logo
#prefect-community
Title
# prefect-community
m

Mahesh

03/23/2021, 1:04 PM
Hi, Iam new to prefect, Trying to run snowflake query with prefect, PFB
Copy code
import prefect
from prefect.tasks.snowflake.snowflake import SnowflakeQuery
from prefect import task, Flow

query = """
    SHOW DATABASES;
"""

snowflake_def = SnowflakeQuery(
    account="account",
    user="user",
    password="****",
    database="***",
    warehouse="****",
    role="***",
    query=query
)

with Flow("hello-snowflake") as flow:
    snowflake_def()

flow.register(project_name="tutorial")
flow.run()
when i trigger quick run from UI, Iam facing below issue
Copy code
Unexpected error: TypeError("cannot pickle '_thread.lock' object")
Traceback (most recent call last):
  File "/opt/prefect_env/lib/python3.8/site-packages/prefect/engine/runner.py", line 48, in inner
    new_state = method(self, state, *args, **kwargs)
  File "/opt/prefect_env/lib/python3.8/site-packages/prefect/engine/task_runner.py", line 900, in get_task_run_state
    result = self.result.write(value, **formatting_kwargs)
  File "/opt/prefect_env/lib/python3.8/site-packages/prefect/engine/results/local_result.py", line 116, in write
    value = self.serializer.serialize(new.value)
  File "/opt/prefect_env/lib/python3.8/site-packages/prefect/engine/serializers.py", line 73, in serialize
    return cloudpickle.dumps(value)
  File "/opt/prefect_env/lib/python3.8/site-packages/cloudpickle/cloudpickle_fast.py", line 72, in dumps
    cp.dump(obj)
  File "/opt/prefect_env/lib/python3.8/site-packages/cloudpickle/cloudpickle_fast.py", line 540, in dump
    return Pickler.dump(self, obj)
TypeError: cannot pickle '_thread.lock' object
I made Checkpoint as FALSE
j

Jenny

03/23/2021, 2:42 PM
Hi @Mahesh - to keep the main channel easy to read, we ask that initial messages be kept short. Would you mind moving your stack-trace and code snippet from your main message into the thread here?
I believe you're encountering an issue that was raised here: https://github.com/PrefectHQ/prefect/issues/3744. I'll check with the team and see if there's any update on that.
8 Views