Confusion around context handler behavior #1254
Labels
note:good-first-issue
A good first issue to get started with
semver:minor
A change requiring a minor version bump
type:enhancement
A general enhancement
Plan
Discussed in #1252
Originally posted by daturkel October 28, 2024
I'm a bit confused about the behavior of context managers in Hera and exactly how they behave under the hood.
If I have a python prelude like this:
There are a couple ways I might be inclined to use this container factory function.
I could declare the Container in global scope, which works:
I could declare the Container in the Workflow scope, which also works, though I'm not sure what the advantage is:
Lastly, I could declare the container in the Steps scope, which does not work:
I would love some information on the advantages of the Workflow and Steps context managers and when to use them, and why the third snippet here doesn't work. There doesn't seem to be a ton in the Hera docs on this topic (though maybe I've missed it) and I wouldn't be against contributing some documentation, but first I'll have to understand the behavior better!
There's some relevant discussion on documentation for idiomatic workflows in this issue: #440
The text was updated successfully, but these errors were encountered: