William Jamir
05/18/2022, 9:04 PMwith Flow(...) as flow:
x = Parameter(...)
...
Which is registered with:
prefect register -p flows/my_file.py --project "MyProject"
But now I dont want to have this flow as a global variable, because my tests need to do some settings before and I dont want to trigger any of the code within this context manager.
I can easily move this to a function, and make it return the flow instance, but I dont know how to deal with the registration by command line.
I mean, its possible to still use the register by command line, or do I need to make it now programmatically?
Basically, I’m looking for a solution like this:
def main():
with Flow(...) as flow:
x = Parameter(...)
...
return flow
Registering
prefect register -p flows/my_file.py:main --project "MyProject"
Kevin Kho
05/18/2022, 9:25 PMif __name__ == __main__
instead and add flow.register() or call your function there?