Carlos Cueto
10/24/2023, 3:23 PMflow.deploy()
function for deployments. My code is stored in Git, so I use flow.from_source()
. Below is my deployment code:
if __name__ == '__main__':
flow.from_source(
source=GitRepository(
url="<https://dev.azure.com/MyData/Prefect-Flows/_git/Prefect2.0-Flows>",
branch="main",
credentials={
"access_token": Secret.load("devops-prefect-repo-pat").get()
}),
entrypoint="assets.py:assets_load"
).deploy(
name="Assets-Load",
description="Loads Assets into db table",
tags=["assets"],
work_pool_name="local-process-workpool",
work_queue_name="my-server",
interval=21600
)
However, upon running this, I get the following error:
File "C:\python_scripts\Prefect2.0-Flows\venv\lib\site-packages\prefect\flows.py", line 1461, in load_flow_from_entrypoint
path, func_name = entrypoint.split(":")
ValueError: too many values to unpack (expected 2)
I did some troubleshooting and printed out entrypoint
variable in the aforementioned flows.py
library package, and it shows the following:
C:\Users\cuet\AppData\Local\Temp\tmp7ir42eb0\Prefect2.0-Flows-main\alm_assets.py:servicenow_assets_load
As you can see from the path above, there's two :
characters, thus the unpacking error above. This seems to only be an issue on Windows machines that contain absolute paths including the drive letter. Is this something that was overlooked or am I doing something incorrectly?Alexander Azzam
10/24/2023, 3:24 PMalex
10/24/2023, 3:26 PMCarlos Cueto
10/24/2023, 3:27 PMCarlos Cueto
10/24/2023, 4:43 PMpip
update to the latest code now.