microsoft / vscode-data-wrangler

Other
442 stars 20 forks source link

Copy rows does not preserve the order of rows in the grid #289

Closed f2bo closed 2 months ago

f2bo commented 2 months ago

Environment data

Expected behaviour

Copying data to the clipboard should maintain the order displayed in the grid.

Actual behaviour

Copy rows copies data to the clipboard after sorting the Index column alphabetically, not numerically (e.g. 0, 1, 10, 11, 12, 13...19, 2, 20, 21...).

Steps to reproduce:

  1. Define a list of strings.
    items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  2. Click View Data and then select the items variable to display in Data Wrangler.
  3. Notice that items are displayed in the same order as they were defined.
  4. Select all rows in the grid and then Copy rows.
  5. Paste the output in a text file and notice that the order has been changed.
    0    a
    1    b
    10   k
    11   l
    ...
    18   s
    19   t
    2    c
    20   u
    21   v
    ...
    25   z
    3    d
    4    e
    ...
pwang347 commented 2 months ago

Hi @f2bo, thank you for reporting the issue! We've merged a fix and will release it early next week. I will update this thread when it is available.

pwang347 commented 2 months ago

Hi @f2bo, thank you for your patience! The issue is now fixed and deployed to pre-release version 1.11.0. We will also add it to the next stable version soon.

f2bo commented 2 months ago

Thank you!