-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should error on Output field usage in DAG/Steps #1222
Comments
This may need something like https://github.com/pwwang/python-varname or https://github.com/alexmojaki/sorcery, or just a stack inspection mechanism to see if the function context is a dag/step-decorated function. We cannot simply check the if "result" in kwargs or "exit_code" in kwargs and isinstance(_context, (DAG, Steps)):
raise SyntaxError("Cannot use `result` or `exit_code` in dag or steps decorator functions.") in hera/src/hera/workflows/io/_io_mixins.py Lines 169 to 174 in 7b7a8c7
As there will be script function calls where Slightly more complex, so will leave out of #1221 and come back to this. Also it's more of an enhancement than a bug fix |
Actually, overcomplicating it for a basic fix - we can just check if |
* Fixes #1222 * Setting result or exit_code for a dag/steps function doesn't make sense, check if they are non-default values on return from the dag setup function and error if so. Signed-off-by: Elliot Gunton <[email protected]>
We can have a separate validation flag in the context, and disable it temporarily in our script decorators? |
I don't think it's worth overcomplicating the codebase for now for a niche error case - the error text added in 5b56891 makes it obvious enough IMO |
Originally from #1162
The text was updated successfully, but these errors were encountered: