Suggestion to improve researcher experience, as experienced by @bakingeol.
pt.apply.query is a wrapper around Pandas apply. If the applied function does not return a string, Pandas error message can be confusing: "ValueError: Columns must be same length as key"
This PR provides a TypeError on top that provides a more useful error message:
TypeError("Could not coerce return from pt.apply.query function into a list of strings. Check your function returns a string.")
Suggestion to improve researcher experience, as experienced by @bakingeol.
pt.apply.query
is a wrapper around Pandas apply. If the applied function does not return a string, Pandas error message can be confusing: "ValueError: Columns must be same length as key"This PR provides a TypeError on top that provides a more useful error message:
TypeError("Could not coerce return from pt.apply.query function into a list of strings. Check your function returns a string.")