to_function() doesn't manage its exceptions well. as far as i've seen, it can return a ValueError, an AttributeError, or an ImportError (which is the only one that failhard affects). i'd clean up to_function() but it seems like any time someone edits dimagi-utils they get yelled at for breaking backwards compatibility.