Repository navigation
fix(table): sort an attribute table column in one total order - #3536
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewI reviewed the diff ( Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared with the whole PR against
|
|
On the summary points, in 78b55c8:
|
Code reviewBugs: none found.
Security: none found. No input handling, parsing or I/O changes. Performance: no regression. The sort now compares text without parsing dates or allocating, which the old Quality:
AGENTS.md: no breaks found.
Earlier review threads: 1 concern left alone. It was the performance note on the date tie-break No inline comments were posted: nothing rose to the level of an inline finding. Change sizeCompared with
|
|
On the two summary notes (no code change):
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Code reviewI found no bugs, security issues, or AGENTS.md breaks in the two changed files. I did not run the tests, since I have no shell here. I checked the code by reading it and the surrounding source. BugsNone found. I checked that SecurityNone found. Performance
Quality
AGENTS.mdNone found. I checked the following:
Twins checked
Prior reviewsOne thread was already on the PR: the performance concern about the date tie-break. The author fixed it in 78b55c8, and the current code matches the fix. I left it alone and did not repeat it. No new inline comments were posted. Change sizeCompared: the whole PR against main (merge base 0a03240 to PR head 78b55c8).
|
|
On the two summary nits (no code change): the tie-break stays inline, as one expression with its reason in the comment above it; and no timing test is added, for the flakiness you name. |
Summary
Sorting an attribute table column used
Value'spartial_cmp, which isn't a total order: a non-finite float is compared as its shown text, so in a decimal column-infcame out between the negative and the positive numbers (-4.5, -0.5, -inf, 3.5, …), and a column mixing kinds could be ordered differently depending on how its rows came.The table now sorts with
value::cmp_values, the order a layout's table already uses (#3479). What changes besides the infinities:Abeforea) instead of keeping row order.cmp_valuesalso now ties two equal dates without building their texts, so a column of repeated dates sorts as fast as before. The layout table and the Statistics group keys use it too; their order is unchanged.The sort is in
ui-egui's attribute table, for layers and standalone tables, on the desktop and in the browser. The command line, Python andshare.exportTabledon't use it, and the touch interface has no sort of its own. No command or project format change.Testing
New unit tests on the table's row order (
row_order_*incrates/ui-egui/src/table.rs):-infboth ways,inf, NaN and null, every permutation of a column mixing null, yes/no, whole, decimal, date and text values (ascending in each, descending once), and sorting with a filter or a selection. Three of the four tests fail without the change; theinf/NaN one pins an ordermainalready gives.Locally, fmt, clippy, doctests, the layer check and the schema check pass. The full test run had 11884 passing and 8 failing: 7 in
rustgis-geolibreandline_strokes_editor_edits_one_class, which also fail here onmain. After a last comment and test edit, therow_ordertests and clippy onrustgis-ui-eguipass again.Headless
ui_shotcaptures of a GeoPackage whose decimal column holds-inf, before and after.UI evidence
Ascending:
Descending:
Related issue
Closes #3483
Summary by CodeRabbit