Aric Huang
09/08/2021, 11:44 PMprefect.context
object or elsewhere?
• The flow ID used in the URL https://cloud.prefect.io/paravision/flow/<ID> seems to be different from the flow ID that's output when registering a flow. Is it possible to get that ID during a flow run through prefect.context
? prefect.context.flow_id
looks like the same one that's returned when registering the flow, but would like to also get this other flow ID.
• When registering a flow, it increments the version number and archives the previous flow version. Is it possible to un-archive a previous version so it can be run again?Kevin Kho
Aric Huang
09/09/2021, 6:50 PMflow_run_version
however. The number returned doesn't match the flow's version number in the UI, for example:Aric Huang
09/09/2021, 6:50 PM@task
def log():
logger = prefect.context.get("logger")
<http://logger.info|logger.info>(f'flow_run_version: {prefect.context.get("flow_run_version")}')
Aric Huang
09/09/2021, 6:51 PMflow_run_version
shows 3 but the version in the UI + at flow registration time is 26Aric Huang
09/09/2021, 6:56 PMNot quite unless the unarchived version's code can be accessed.
- I am registering the flows with GCP storage, so the old flow code should be persisted there right? I do see old flow files corresponding to old versions in the GCP bucket. It seems like it would be possible to reference them, except that Prefect is archiving the old flows.Aric Huang
09/09/2021, 7:11 PMarchive_flow
and archiveFlow
mutations, but not seeing any way to unarchive a flowKevin Kho
Kevin Kho
flow_version
but the context gives flow_run_version
which is not the same. You may need to use the GraphQL API to get that number you want.Aric Huang
09/09/2021, 7:34 PMKevin Kho
Aric Huang
09/09/2021, 7:37 PMKevin Kho
Aric Huang
09/09/2021, 7:38 PMKevin Kho
Aric Huang
09/09/2021, 7:42 PMCooper Marcus
09/17/2021, 1:05 AMKevin Kho
Cooper Marcus
09/19/2021, 5:13 AMEldho Suresh
09/20/2021, 10:04 AMKevin Kho
Eldho Suresh
09/20/2021, 11:27 PMKevin Kho
query {
flow_run (where: {id: {_eq: "6082914d-c89a-40ca-af1c-8c77e9827475"}}){
id
flow {
project {
name
}
name
}
tenant {
name
}
}
}
Eldho Suresh
09/20/2021, 11:36 PMEldho Suresh
09/20/2021, 11:38 PMKevin Kho
Eldho Suresh
09/20/2021, 11:41 PMKevin Kho
Eldho Suresh
09/21/2021, 3:54 AMKevin Kho
from prefect.client.client import Client
client = Client()
client.graphql(query)
right?Eldho Suresh
09/21/2021, 3:59 AMKevin Kho
Eldho Suresh
09/30/2021, 7:28 AM