I see in the v2 UI an option to add tags to a flow run in the Custom Run screen. Is it possible append these tags to a specific run from the flow code itself?
I'm thinking of using this to tag runs if a user provides a backfilling window. This can be useful to separate all backfills from live loads of data for example.
n
Nate
07/01/2024, 4:38 AM
hi @Jacob Blanco !
what about using an
on_running
hook to append runtime context as tags like this
Copy code
» python flows/proofs/tag_me.py
23:34:23.697 | INFO | prefect.engine - Created flow run 'happy-otter' for flow 'f'
23:34:23.820 | INFO | prefect.engine - Running hook 'tag_me' in response to entering state 'Running'
23:34:23.966 | INFO | prefect.engine - Hook 'tag_me' finished running successfully
23:34:24.048 | INFO | Flow run 'happy-otter' - got backfill='squirrels'
23:34:24.158 | INFO | Flow run 'happy-otter' - Finished in state Completed()
Nice this is cool.
It would be good to have this integrated into our data engineering libraries so that data-scientists don't need to add this on-running parameter every time. Let me try and see how far I get.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.