Skip to content
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

improved error message pt.apply.query - from #433 #434

Merged
merged 1 commit into from
Apr 9, 2024
Merged

Conversation

cmacdonald
Copy link
Contributor

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.")

@cmacdonald cmacdonald merged commit 89a29cb into master Apr 9, 2024
12 of 13 checks passed
@cmacdonald cmacdonald deleted the issue_433 branch April 9, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant