capitalone / DataProfiler

What's in your data? Extract schema, statistics and entities from datasets
https://capitalone.github.io/DataProfiler
Apache License 2.0
1.42k stars 158 forks source link

fix: datetime profile JSON encoding bug #1101

Closed scottiegarcia closed 6 months ago

scottiegarcia commented 6 months ago

This fix pertains to my recently created issue here. The JSON encoder was only expecting/being tested for pd.Timestamp as values for _dt_obj_min and _dt_obj_max, but I ran into a case where those fields were datetime.datetime objects.

Running the newly created test on the lastest release reproduces the bug, running on this branch resolves it.

scottiegarcia commented 6 months ago

Mocking pd.DataFrame in one of the tests was causing a new function in sklearn==1.4.1 to error. Since the erroring test_save_conf_mat function is just trying to ensure that the correct confusion matrix is generated and other functions validate the f1_report, I figure just mocking that classification_report function is the easiest path forward