https://prefect.io logo
Title
m

Madison Schott

11/15/2022, 5:55 PM
Hi, I am getting this error importing fivetran's tasks:
from prefect_fivetran.connectors import fivetran_sync_flow
ImportError: cannot import name 'fivetran_sync_flow' from 'prefect_fivetran.connectors' (/usr/local/lib/python3.9/site-packages/prefect_fivetran/connectors.py)
n

Nate

11/15/2022, 6:03 PM
I don't believe there's anything called
fivetran_sync_flow
defined in that collection, I think you want this one
m

Madison Schott

11/15/2022, 6:03 PM
n

Nate

11/15/2022, 6:04 PM
ahh that appears to be a typo, I'll open an issue
m

Madison Schott

11/15/2022, 7:24 PM
I'm confused- even in that Github repo I see
from prefect_fivetran.connectors import fivetran_sync_flow
n

Nate

11/15/2022, 7:27 PM
Sorry about the confusion - we don't own this repo, it's managed by Fivetran so for the moment we've opened a PR with the documentation fixes and are awaiting their review that PR will fix the reference to the non-existent
fivetran_sync_flow
in: • the first readme / PyPI example • here in connectors.py
you can check out the updated docs on this branch
m

Madison Schott

11/15/2022, 7:34 PM
thanks!
I
I'm not getting this error, related to that async wait question I had the other day:
RuntimeError: A 'sync_compatible' method was called from a context that was previously async but is now sync. The sync call must be changed to run in a worker thread to support sending the coroutine for 'load' to the main thread.
any idea how to fix this? My task looks like:
@task
def webevent_sync(fivetran_credentials):
    webevents_secret = Secret.load("webevents-connector_id")
    webevents_sync = trigger_fivetran_connector_sync_and_wait_for_completion(
        fivetran_credentials=fivetran_credentials,
        connector_id=webevents_secret.get(),
        schedule_type="manual",
        poll_status_every_n_seconds=30,
    )
n

Nate

11/15/2022, 9:36 PM
what does
prefect version
show?
m

Madison Schott

11/15/2022, 9:37 PM
`
Version:             2.3.2
API version:         0.8.0
Python version:      3.9.13
Git commit:          6e931ee9
Built:               Tue, Sep 6, 2022 12:36 PM
OS/Arch:             darwin/x86_64
Profile:             madisonschott
Server type:         cloud
n

Nate

11/15/2022, 9:37 PM
hmm can you upgrade via
pip install -U prefect
? This issue should be handled in recent versions
m

Madison Schott

11/15/2022, 9:43 PM
Ok that seemed to get rid of that error- now I'm seeing
prefect.exceptions.ScriptError: Script at 'data_pipeline_2.0_prod.py' encountered an exception
An exception occurred.
sys:1: RuntimeWarning: coroutine 'Block.load' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback