MrPowers / chispa

PySpark test helper methods with beautiful error messages
https://mrpowers.github.io/chispa/
MIT License
595 stars 65 forks source link

Font colors in error messages are bad in some terminals #66

Open MrPowers opened 1 year ago

MrPowers commented 1 year ago
Screenshot 2023-08-09 at 10 25 06 AM

The white color font to underline cell differences isn't great in my terminal for example. It'd be totally unreadable in a terminal with a white background.

We should try to make two improvements:

calum-mcg commented 1 year ago

Determining default terminal colours is difficult and impossible in some cases. We could try to guess, but for the sake of simplicity it might be easier to do the following:

colour_scheme = {
   default:'red',
   matched:'blue',
   underlined:'green'    
}
assert_df_equality(df1, df2, underline_cells=True, colour_scheme=colour_scheme)

We would need to add a validation step for the colour scheme dict.