Skip to content

Conversation

@mwouts
Copy link
Owner

@mwouts mwouts commented Jul 1, 2025

Closes #415

@github-actions
Copy link

github-actions bot commented Jul 1, 2025

Thank you for making this pull request.

Did you know? You can try it on Binder: Binder:lab.

Also, the version of ITables developed in this PR can be installed with pip:

pip install git+https://github.com/mwouts/itables.git@version_2.4.3

(this requires nodejs, see more at Developing ITables)

@mwouts mwouts requested a review from Copilot July 1, 2025 22:17
Copy link

Copilot AI left a 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 fixes an issue where the DataFrame index was not shown when Polars was not installed by adjusting the _evaluate_show_index logic, adds a test to verify index display, bumps the version to 2.4.3, and updates the changelog.

  • Adjust _evaluate_show_index to compare pl against pd so absence of Polars still shows index.
  • Add test_get_itable_arguments_with_index to ensure indices are included in data_json.
  • Bump version and document the fix in changelog.md.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/test_javascript.py Added a new test to verify index inclusion when Polars is not installed
src/itables/version.py Bumped version from 2.4.2 to 2.4.3
src/itables/javascript.py Updated _evaluate_show_index condition to use pl is not pd
docs/changelog.md Added 2.4.3 changelog entry for the Polars index fix
Comments suppressed due to low confidence (2)

tests/test_javascript.py:46

  • [nitpick] The docstring here doesn't describe the new test’s intent. Consider updating it to explain that this test verifies index display when Polars is not installed.
    As much as possible we want few arguments for the ITable class

docs/changelog.md:8

  • [nitpick] Consider rephrasing for clarity, e.g., 'Fixed issue where index was not shown when Polars was not installed.'
- We have fixed an issue with an index not shown when `polars` was not installed ([#415](https://github.com/mwouts/itables/issues/415))

if showIndex != "auto":
return showIndex
if df is None:
return False
Copy link

Copilot AI Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Add a comment explaining why we're comparing 'pl' to 'pd' here, so future readers understand the aliasing logic when Polars is not available.

Suggested change
return False
return False
# If Polars is not available, `pl` is aliased to `pd`. This check ensures
# that we correctly handle Polars DataFrames when Polars is available.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.82%. Comparing base (b1a6017) to head (3a279eb).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #416      +/-   ##
==========================================
+ Coverage   87.79%   87.82%   +0.03%     
==========================================
  Files          50       50              
  Lines        2007     2012       +5     
==========================================
+ Hits         1762     1767       +5     
  Misses        245      245              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mwouts mwouts merged commit 73b7aa7 into main Jul 1, 2025
15 checks passed
@mwouts mwouts deleted the version_2.4.3 branch July 1, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The index of a DataFrame is not shown in v2.4.2 when polars is not installed

3 participants