I recently ran into a problem where a task I was working on had optional inputs, and had to distinguish between not producing output because there was nothing to do and not producing output because of an internal error. @parejkoj suggested using Python’s warnings.warn
to represent the former case, just in case the user was expecting the optional inputs to be present. However, when we looked more closely we found that Python warnings require some high-level support to be useful: for example, warnings.warn
's text output will bypass the logger unless specifically configured to use it.
That got us wondering about whether there should be a Stack policy on how to handle situations that are normally expected but might represent problems, and in particular whether PipelineTask
or Pipeline
activators could have support for something like warnings
. Is standardized use of warnings
or an equivalent policy something Stack developers would find useful?