Hmm, the concept of "building" flows when register...
# ask-community
a
Hmm, the concept of "building" flows when registering is a bit vague and I cannot find documentation on this. What does it actually mean to provide
build=True
? The doc states:
if
True
, the flow's environment is built prior to serialization; defaults to
True
Basically, I'm trying to automate the registration of flow in a CI environment, and I get warnings such as:
Copy code
UserWarning: A flow with the same name is already contained in storage; if you changed your Flow since the last build, you might experience unexpected issues and should re-create your storage object.
  serialized_flow = flow.serialize(build=build)
Well, basically, since I'm automating the registration of flows, I do not really know which ones are new, which ones are identical, and which ones changed.
k
Hi @Aurélien Vallée! You don’t need to provide build to register. Maybe this thread will clear things up about
build
https://prefect-community.slack.com/archives/CL09KU1K7/p1618314314486300
a
So if I understand correctly from the message your forwarded, a flow has to be built, and the result of that build is then registered. Also, prefect.register() can make that build step under the hood if required. I'm still a bit confused by the warning though. I don't really understand what it warns me against doing. What is the actual thing that I should be warned not to do? Re-registering already existing flows seems to be OK, even more so when using idempotency keys.
k
Your understanding is correct. Yes the warning seems a bit excessive. I will bring that up with the team, but in general just register will be enough.