Skip to content
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

Tabulator: simplify event row calculation #3841

Merged
merged 2 commits into from Sep 15, 2022

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Sep 15, 2022

Instead of relying on the actual (i.e. visual) position of the row clicked/edited this PR computes an index mapping - that relies on the existence of the hidden _index column used on the front-side for other reasons - and use that index when processing a click/edit event to obtain the actual row iloc in the value DataFrame. This has the effect to not have to rely on sorting data to get the row iloc, which as seen recently caused issue due to divergences between Tabulator JS' sorting algorithms and Pandas df.sort_values().

@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #3841 (5750aa0) into master (23b061b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3841   +/-   ##
=======================================
  Coverage   82.86%   82.87%           
=======================================
  Files         222      222           
  Lines       32426    32427    +1     
=======================================
+ Hits        26871    26875    +4     
+ Misses       5555     5552    -3     
Flag Coverage Δ
ui-tests 34.21% <25.00%> (+<0.01%) ⬆️
unitexamples-tests 75.29% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
panel/widgets/tables.py 88.55% <100.00%> (+0.10%) ⬆️
panel/tests/command/test_serve.py 85.00% <0.00%> (+2.50%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@philippjfr
Copy link
Member

Agree this is significantly cleaner!

@philippjfr philippjfr merged commit 7b2ad21 into master Sep 15, 2022
@philippjfr philippjfr deleted the tabulator_simplify_event_row branch September 15, 2022 17:47
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.

None yet

2 participants