civis-python icon indicating copy to clipboard operation
civis-python copied to clipboard

Make use_pandas=True the default

Open stephen-hoover opened this issue 5 years ago • 0 comments

Several of this library's convenience functions (e.g. civis.io.read_civis) have the option to return their results as either a list or as a pandas DataFrame. Users control the return type by passing a boolean to a use_pandas keyword argument. This default to False.

History: We originally set this parameter to default to False because of a strong desire to require as few dependencies as possible. Users aren't required to install pandas, and users who choose not to install it should still have an error-free experience using the Civis API client.

Proposal: Change the default of use_pandas to True for all functions where it exists. In most cases, a DataFrame will be a more useful return type, and the default should reflect typical usage.

To maintain an error-free experience, we could check at the beginning of affected functions whether or not pandas is installed and force use_pandas=False where pandas is not present. (Possibly with a warning message.)

This would change the API of several functions, so it would need to be part of a v2 release.

stephen-hoover avatar Feb 14 '20 21:02 stephen-hoover