You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when one is creating a Workflow with steps that may be defined elsewhere, for example having a separate python function that defines the Steps and invoking it from a Workflow users may try to instantiate the Steps outside the context of the Workflow leading to a non-intuitive error message.
Traceback (most recent call last):
File "/testing/hera-examples/reusable-steps-error-message.py", line 18, in<module>
my_steps = my_steps_def()
^^^^^^^^^^^^^^
File "/testing/hera-examples/reusable-steps-error-message.py", line 14, in my_steps_def
echo(arguments={"message": "Hello world!"})
File "/testing/.venv/lib/python3.11/site-packages/hera/workflows/script.py", line 599, in task_wrapper
return s.__call__(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/testing/.venv/lib/python3.11/site-packages/hera/workflows/_mixins.py", line 667, in __call__
return Step(*args, template=self, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 349, in pydantic.main.BaseModel.__init__
File "/testing/.venv/lib/python3.11/site-packages/hera/shared/_global_config.py", line 150, in _init_private_attributes
self.__hera_init__()
File "/testing/.venv/lib/python3.11/site-packages/hera/workflows/_context.py", line 28, in __hera_init__
_context.add_sub_node(self)
File "/testing/.venv/lib/python3.11/site-packages/hera/workflows/_context.py", line 93, in add_sub_node
fortin pieces[0].templates: # type: ignore
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Steps' object has no attribute 'templates'
The error message above could be improved by suggesting the user that the object that is being instantiated should be within a Workflow context.
The text was updated successfully, but these errors were encountered:
Currently when one is creating a Workflow with steps that may be defined elsewhere, for example having a separate python function that defines the Steps and invoking it from a Workflow users may try to instantiate the Steps outside the context of the Workflow leading to a non-intuitive error message.
For example:
Leads to the following stacktrace:
The error message above could be improved by suggesting the user that the object that is being instantiated should be within a
Workflow
context.The text was updated successfully, but these errors were encountered: