Farid
02/04/2022, 12:45 AMSTORAGE
for the flows and have the Gitlab CI/CD register the flows to the Prefect Cloud.
However, I receive an error when I try to run the dummy flow taken from the official docs :
from prefect import task, Flow
from prefect.storage import Gitlab
@task(log_stdout=True)
def hello_task():
text = f"hello World"
print(text)
return text
with Flow(
"hello-flow",
storage=Gitlab(
repo="predicthq/data-engineering/prefect-server",
path="flows/hello-world/flow_hello_flow.py",
access_token_secret="",
),
) as flow:
hello_task()
The error:
(.venv) ➜ prefect-server git:(main) ✗ python flows/hello-world/flow_hello_flow.py
Traceback (most recent call last):
File "/Users/farid/WorkSpace/Github_Repos/dataobs-poc/prefect-server/flows/hello-world/flow_hello_flow.py", line 2, in <module>
from prefect.storage import Gitlab
ImportError: cannot import name 'Gitlab' from 'prefect.storage' (/Users/farid/WorkSpace/Github_Repos/dataobs-poc/prefect-server/.venv/lib/python3.9/site-packages/prefect/storage/__init__.py)
Looking at the source code, I don’t see anything that could cause a dependency circle. Any idea what it could be causing this?
Needles to say that I have installed the gitlab package: pip install 'prefect[gitlab]'
Kevin Kho
Kevin Kho
Farid
02/04/2022, 12:52 AMKevin Kho
Kevin Kho
from prefect.storage import GitLab
Kevin Kho
Marvin
02/04/2022, 12:57 AMFarid
02/04/2022, 1:09 AM