rstudio / pins-python

https://rstudio.github.io/pins-python/
MIT License
50 stars 12 forks source link

Fix misleading error message in `_assert_is_pandas_df` #252

Closed nathanjmcdougall closed 2 months ago

nathanjmcdougall commented 2 months ago

This helper function _assert_is_pandas_df is called for a variety of file formats, but the error message mentions CSV specifically:

https://github.com/rstudio/pins-python/blob/70380b4532f3778e4777888507a49c2d1cab1ae8/pins/drivers.py#L17-L23

I think this function should be changed to accept a type argument so that an appropriate message can be constructed dynamically.

isabelizimm commented 2 months ago

That makes sense to use a type argument! It is a helper function that is only used in pins-python/pins/drivers.py, and always is in the context of an if type == ... block 👍