-
Notifications
You must be signed in to change notification settings - Fork 235
Allow validate_output_table_type to specify the supported output types #3191
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
Conversation
ec0f518 to
28eb1df
Compare
| + ", ".join(f"'{v}'" for v in valid_types[:-1]) | ||
| + f", or '{valid_types[-1]}'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines convert a list/tuple like ("pandas", "numpy", "file") to a string like 'pandas', 'numpy', or 'file', which is useful for raising a warning or error.
Perhaps we should wrap it as a utility function so that it can be reused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to leave this as is for now.
| + ", ".join(f"'{v}'" for v in valid_types[:-1]) | ||
| + f", or '{valid_types[-1]}'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to leave this as is for now.
For some module wrappers,
output_type="numpy"makes no sense (e.g., #3182 (comment)).This PR adds a new parameter
valid_typesto thevalidate_output_table_typefunction. It defaults to('pandas', 'numpy', 'file'). If a module wrapper doesn't supportnumpy, then just setvalid_types=('pandas', 'file').