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: ignore case when sorting strings #3825

Merged
merged 4 commits into from
Sep 12, 2022
Merged

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Sep 12, 2022

Tabulator JS implements its own sorting algorithms which for the string type ignores the case, while df.sort_values does and is used internally to mirror what happens on the client side. This PR adds a key function to sort_values so that strings are temporally lower-cased to sort them.

@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #3825 (9e04499) into master (5db6674) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3825      +/-   ##
==========================================
+ Coverage   83.00%   83.02%   +0.01%     
==========================================
  Files         221      221              
  Lines       32312    32328      +16     
==========================================
+ Hits        26821    26840      +19     
+ Misses       5491     5488       -3     
Flag Coverage Δ
ui-tests 34.19% <100.00%> (+0.03%) ⬆️
unitexamples-tests 75.49% <47.05%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
panel/tests/ui/widgets/test_tabulator.py 98.85% <100.00%> (+<0.01%) ⬆️
panel/widgets/tables.py 88.49% <100.00%> (+0.07%) ⬆️
panel/util.py 87.54% <0.00%> (+0.37%) ⬆️
panel/tests/util.py 87.12% <0.00%> (+1.98%) ⬆️

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

panel/widgets/tables.py Outdated Show resolved Hide resolved
@philippjfr
Copy link
Member

One suggestion about taking fixed length string and unicode columns into account, otherwise this looks good.

maximlt and others added 2 commits September 12, 2022 12:39
Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
@philippjfr philippjfr merged commit 87f79fa into master Sep 12, 2022
@philippjfr philippjfr deleted the tabulator_sorting_algo branch September 12, 2022 14:00
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