great-tables
great-tables copied to clipboard
Add truncate option to data_color
Summary
This PR adds a new boolean parameter truncate to the data_color method. When truncate=True, values outside the specified domain will be assigned the color of the domain's minimum or maximum value instead of being treated as NaN. The default is set to truncate=False, which follows the previous functionality.
Changes include:
- Added the
truncateparameter (default: False) - Updated the
_rescale_numericfunction to support truncation - Added unit tests
test_data_color_truncateintests/data_color/test_data_color.pyto verify that truncation works correctly
This close #430
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.42%. Comparing base (
9f7c334) to head (27e5915). Report is 3 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #673 +/- ##
==========================================
+ Coverage 91.40% 91.42% +0.02%
==========================================
Files 47 47
Lines 5629 5634 +5
==========================================
+ Hits 5145 5151 +6
+ Misses 484 483 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@machow hope this PR is going to be integrated into the next release of GT!
Thank you!
@rich-iannone I think this is ready if you don't mind reviewing! I didn't look in-depth at the documentation / try it, just tweaked the code