-
Notifications
You must be signed in to change notification settings - Fork 59
Render non-trivial indexes of Pandas Styler object #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for making this pull request. Did you know? You can try it on Binder: Also, the version of ITables developed in this PR can be installed with (this requires |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that non-trivial Pandas Styler indexes are rendered in the output, addressing issue #393.
- Added
_is_index_trivialhelper and refactoredshowIndex="auto"logic to use it - Introduced tests for including/excluding trivial and non-trivial indexes in Styler output
- Updated changelog to document the new behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_javascript.py | Added tests for non-trivial and trivial index rendering logic |
| src/itables/javascript.py | Introduced _is_index_trivial and updated showIndex handling |
| docs/changelog.md | Added changelog entry for rendering non-trivial Styler indexes |
Comments suppressed due to low confidence (2)
tests/test_javascript.py:182
- [nitpick] The test name suggests trivial indexes are included, but the docstring says they should not be. Consider renaming to
test_trivial_index_not_included_in_pd_stylerfor clarity.
def test_trivial_index_is_included_in_pd_styler(showIndex):
src/itables/javascript.py:349
- [nitpick] The name
_is_index_trivialreturns true for non-trivial indexes (index name set or non-RangeIndex). Consider renaming it to_is_index_non_trivialor similar to match its behavior.
def _is_index_trivial(df) -> bool:
src/itables/javascript.py
Outdated
| ) | ||
|
|
||
|
|
||
| def _is_index_trivial(df) -> bool: |
Copilot
AI
May 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a docstring explaining what constitutes a 'trivial' vs. 'non-trivial' index so users and maintainers understand the helper's criteria.
f809b24 to
8ccf92f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #399 +/- ##
==========================================
+ Coverage 89.27% 89.39% +0.12%
==========================================
Files 44 44
Lines 1836 1858 +22
==========================================
+ Hits 1639 1661 +22
Misses 197 197 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8ccf92f to
2647f15
Compare
Fix #393