https://prefect.io logo
Title
p

Pranit

08/26/2022, 11:26 AM
Hello I am trying to integrate prefect cloud with Airbyte. But I am facing below error
ModuleNotFoundError: No module named 'prefect.tasks.airbyte'; 'prefect.tasks' is not a package
Have I missed to install any dependency ? I didnt see anything on airbyte/prefect pages
1
FYI I have already done
pip install prefect-airbyte
j

Jeff Hale

08/26/2022, 11:28 AM
Are you using Prefect 1 or 2?
☝️ 1
p

Pranit

08/26/2022, 11:29 AM
2
j

Jeff Hale

08/26/2022, 11:29 AM
Ah yes. The import you are using is for Prefect 1. Here are the docs for 2: https://prefecthq.github.io/prefect-airbyte/
a

Anna Geller

08/26/2022, 11:29 AM
can you follow the docs here https://prefecthq.github.io/prefect-airbyte/ to see which integrations are possible? There are no tasks in this collection but there are connections, configuration etc
p

Pranit

08/26/2022, 11:32 AM
@Anna Geller I am already following same page
pip dependency is installed but not able to find that module
a

Anna Geller

08/26/2022, 11:33 AM
there are no tasks
p

Pranit

08/26/2022, 11:34 AM
a

Anna Geller

08/26/2022, 11:34 AM
can you check examples from those docs? you may be using some outdated examples
p

Pranit

08/26/2022, 11:34 AM
Used the same example given on your page
a

Anna Geller

08/26/2022, 11:35 AM
try this:
from prefect import flow
from prefect_airbyte.connections import trigger_sync


@flow
def example_trigger_sync_flow():

      # Run other tasks and subflows here

      trigger_sync(
            connection_id="your-connection-id-to-sync",
            poll_interval_s=3,
            status_updates=True
      )

example_trigger_sync_flow()
p

Pranit

08/26/2022, 11:39 AM
tried, doent work
a

Anna Geller

08/26/2022, 11:44 AM
perhaps you can try in a new environment? otherwise, it might be worth opening an issue in the collection repo, providing MRE and explaining what doesn't work as expected
p

Pranit

08/26/2022, 11:45 AM
I executed this basic dag , which is working
from prefect import flow, get_run_logger

@flow(name="Testing")
def basic_flow():
    logger = get_run_logger()
    logger.warning("The fun is about to begin")

if __name__ == "__main__":
    basic_flow()
resolved it thanks
👍 1
🙌 1