Skip to content

Allow table_id in DT #418

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

Merged
merged 2 commits into from
Jul 8, 2025
Merged

Allow table_id in DT #418

merged 2 commits into from
Jul 8, 2025

Conversation

mwouts
Copy link
Owner

@mwouts mwouts commented Jul 7, 2025

Might close #417

Copy link

github-actions bot commented Jul 7, 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@fix_417

(this requires nodejs, see more at Developing ITables)

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.08%. Comparing base (73b7aa7) to head (aefe9fe).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
+ Coverage   87.82%   88.08%   +0.26%     
==========================================
  Files          50       50              
  Lines        2012     2014       +2     
==========================================
+ Hits         1767     1774       +7     
+ Misses        245      240       -5     

☔ 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 requested a review from Copilot July 8, 2025 20:27
Copy link

@Copilot 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

Adds support for specifying table_id in DT, ensuring Shiny apps receive selection events.

  • Bumps package version to 2.4.4
  • Updates DT to replace initialization code and append selection‐setting script when table_id is provided
  • Adds a basic test and updates the changelog

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/test_shiny.py Adds test_table_id_in_DT to exercise passing table_id
src/itables/version.py Increments version from 2.4.3 to 2.4.4
src/itables/shiny.py Imports replace_value, adjusts HTML generation for table_id
docs/changelog.md Adds 2.4.4 entry noting fix for table_id support
Comments suppressed due to low confidence (2)

tests/test_shiny.py:81

  • The test currently only calls DT(...) without verifying output. Consider asserting that the returned HTML contains the expected my_table1_selected_rows code or the updated let dt = new ITable snippet to ensure behavior is actually tested.
    DT(df=None, table_id="my_table1")

docs/changelog.md:8

  • The changelog references issue #414, but the PR metadata indicates #417. Update the issue number for consistency.
- We have fixed an assertion when a `table_id` is passed to `DT` ([#414](https://github.com/mwouts/itables/issues/414))

@mwouts mwouts merged commit 6873da3 into main Jul 8, 2025
15 checks passed
@mwouts mwouts deleted the fix_417 branch July 8, 2025 20:29
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.

AssertionError when using shiny DT with table_id
2 participants