https://prefect.io logo
c

Chris L.

07/29/2021, 2:10 AM
Hello Prefect community! Just a quick question: is there a simple convenience function to check if a flow has been successfully registered? (e.g.
flow.is_registered()
). Otherwise, is there a gist for using
prefect.client
and working with the graphql response? Thanks in advance
k

Kevin Kho

07/29/2021, 2:13 AM
Hey @Chris L., quick answer is no. I think we can do it by hitting the GraphQL API easily. Just a few clarifying questions. What do you imagine this would check? Query for the existence of a flow with the given name and project? Also, what is the use case you’re trying? Prevent overwriting?
c

Chris L.

07/29/2021, 2:18 AM
It is probably pedantic, but it's to check if 1. the flow (during testing) has been accidentally registered to the "prod" project instead of the "dev" project; 2. that the flow has in fact been registered (though perhaps it'll be better to catch any exceptions during
.register
instead)
k

Kevin Kho

07/29/2021, 2:26 AM
I’m not sure this can be done because it would work for the first time around, but when you iterate over that flow and re-register and query for the existence in the prod project, you’ll always get a flow back, even if it’s an outdated version. Does that make sense?
upvote 1
Out of curiosity, you have the Pusheen picture in the Coiled Slack right? 😆
🙌 1
c

Chris L.

07/29/2021, 2:27 AM
Yeah this seems unnecessary on closer inspection. Thanks kevin!
Ahh yes that is me, I haven't changed it to my girlfriend's laser eyed cat yet
🤣 2
3 Views