Add __cause__ to produce_data_input
Created by: wilsonmr
After #937 I thought it would be good if we also got a cause when trying to produce data_input
so I extracted the underlying function which raises the inner error from the outer one and then call it in both fitinputcontext
and data_input
production rules.
This is slightly gross but I tried to add decent amount of docstring so that it's at least vaguely clear to other people