# prefect-community

Shubham Wani

12/24/2022, 7:39 PM
#needHelp Using Prefect 2.7, I'm trying to connect a MYSQL databse to write data through a prefect task. once I run
Copy code
cursor.executemany(query, values),
I run the
Copy code
to to transfer all data from buffer to the table in dataset. Error faced in the following command:
Copy code
Copy code
00:12:33.556 | ERROR   | Task run 'load_records-41eb504c-0' - Encountered exception during execution:
Traceback (most recent call last):
  File "/home/shubhamwani/nice/lib/python3.8/site-packages/prefect/", line 1346, in orchestrate_task_run
    result = await run_sync(task.fn, *args, **kwargs)
  File "/home/shubhamwani/nice/lib/python3.8/site-packages/prefect/utilities/", line 69, in run_sync_in_worker_thread
    return await anyio.to_thread.run_sync(call, cancellable=True)
  File "/home/shubhamwani/nice/lib/python3.8/site-packages/anyio/", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/shubhamwani/nice/lib/python3.8/site-packages/anyio/_backends/", line 937, in run_sync_in_worker_thread
    return await future
  File "/home/shubhamwani/nice/lib/python3.8/site-packages/anyio/_backends/", line 867, in run
    result =, *args)
  File "/home/shubhamwani/nice/prefect_flows/load/", line 166, in load_records
TypeError: cannot unpack non-iterable NoneType object
I've tried using different sql connectors(mysqlclient, mysql-connector, pymysql), but the error persists. is this somehow related to prefect? anyone else facing this issue? Any help is welcomed, Thanks.

Santhosh Solomon (Fluffy)

12/25/2022, 5:51 AM
The error seems to be from your flow only, where the load_records function is expecting an iterable but received a None object.
gratitude thank you 4

Shubham Wani

12/25/2022, 6:42 PM
Yep, that's the issue, thanks.
👍 1