Chris L.

    Chris L.

    1 year ago
    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
    Kevin Kho

    Kevin Kho

    1 year ago
    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?
    Chris L.

    Chris L.

    1 year ago
    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)
    Kevin Kho

    Kevin Kho

    1 year ago
    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?
    Out of curiosity, you have the Pusheen picture in the Coiled Slack right? 😆
    Chris L.

    Chris L.

    1 year ago
    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