Jons Cyriac
12/22/2022, 5:03 AMJeff Hale
12/23/2022, 2:40 PMDeployment.build_from_flow()
Jons Cyriac
12/26/2022, 6:07 AMload_flows_from_script
.
flow = load_flows_from_script(path=str(path))
It throws
File "/usr/local/lib/python3.9/site-packages/prefect/deployments.py", line 696, in build_from_flow
module = importlib.import_module(mod_name)
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named '__prefect_loader__'
It works fine if im importing the flow directly.Jeff Hale
12/28/2022, 6:47 PMJons Cyriac
12/29/2022, 2:36 AMPREFECT_API_URL
pythonically before calling build_from_flow()
Jeff Hale
12/29/2022, 5:09 PMPREFECT_API_URL
is an environment variable for the client. You can just set it on the client directly from the CLI.Jons Cyriac
01/03/2023, 2:29 AMfrom prefect.client.client import Client
client = Client(api_server="***")
build_and_register(client, flow, project_id, schedule=False)
(i prefer this since im multiple orion instances for our ci/cd).../prefect/blocks/core.py
load()
Jeff Hale
01/03/2023, 3:19 AMinject_client
decorator might be worth checking out. You can see the source code here.
I’ll ask folks who are more familiar with that part of the code base than me if they have any insights tomorrow, Tuesday, when they are expected to be available and will report back. In the meantime, if you’d be so kind as to remove your message on this topic in the #prefect-community channel to keep it tidy, that would be great.Christopher Boyd
01/03/2023, 1:54 PMimport os
os.environ["PREFECT_API_URL"] = "<address>"
Jons Cyriac
01/09/2023, 11:57 AM