skrub icon indicating copy to clipboard operation
skrub copied to clipboard

Improve error message for non-dataframe input in the TableReport

Open Vincent-Maladiere opened this issue 7 months ago • 4 comments

Fixes https://github.com/skrub-data/skrub/issues/1408

Additionally, we could add this error message to all sbd functions. WDYT?

Vincent-Maladiere avatar May 26 '25 14:05 Vincent-Maladiere

Additionally, we could add this error message to all sbd functions. WDYT?

i think that would be good, and I would suggest replacing the NotImplementedError with a TypeError -- for user point of view the issue is not a missing implementation, it's that they passed an unsupported type

jeromedockes avatar Jun 01 '25 21:06 jeromedockes

I just realized there are more sbd functions spread around other files that should be updated, like in _datetime_encoder.py and _to_datetime.py

rcap107 avatar Jun 11 '25 08:06 rcap107

I think it's worth bringing them into the _common.py file for consistency and discoverability (currently, it's easy to forget them, as I just have)

As long as it does not lead to circular imports (which can be circumvented, but are a hint of bad code organization)

GaelVaroquaux avatar Jun 11 '25 12:06 GaelVaroquaux

As long as it does not lead to circular imports (which can be circumvented, but are a hint of bad code organization)

I reverted my message after further reading, as I now understand that these functions make sense within their respective contexts

Vincent-Maladiere avatar Jun 11 '25 12:06 Vincent-Maladiere

Technically, the coverage should be the same, because we're replacing an error with another one, but I can add a few tests to make codecov happier

Vincent-Maladiere avatar Jun 24 '25 07:06 Vincent-Maladiere

Technically, the coverage should be the same, because we're replacing an error with another one, but I can add a few tests to make codecov happier

makes sense, but why is it complaining then :thinking: just coverage things?

rcap107 avatar Jun 24 '25 08:06 rcap107

I'm not sure, Codecov has been quite buggy in the past

Vincent-Maladiere avatar Jun 24 '25 08:06 Vincent-Maladiere

I'm not sure, Codecov has been quite buggy in the past

Yes. It's not incredibly reliable.

GaelVaroquaux avatar Jun 24 '25 20:06 GaelVaroquaux

Thanks a lot @Vincent-Maladiere!

rcap107 avatar Jun 27 '25 09:06 rcap107