Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Derived transposed sheet cells do not keep source column type #2575

Open
pacien opened this issue Oct 19, 2024 · 0 comments
Open

Derived transposed sheet cells do not keep source column type #2575

pacien opened this issue Oct 19, 2024 · 0 comments
Labels

Comments

@pacien
Copy link
Contributor

pacien commented Oct 19, 2024

Small description

This is a follow-up to #2548.

The cells in the derived transposed sheets do not seem to keep the type and formatters from the origin columns.

This is happening for example for monetary columns ($) or date columns (@).

Data to reproduce
None.

Steps to reproduce

Example 1: open visidata in your home directory, then transpose that file list sheet. Notice that the "modtime" values cells are now floats instead of dates like in the source sheet.

Example 2: create a column "A/B" as the result of A/B, then assign it the monetary column type. The cells in the transposed sheet "forget" the monetary type, displaying a float instead:

#!vd -p
{"sheet": null, "col": null, "row": null, "longname": "open-file", "input": "test.tsv", "keystrokes": "o", "comment": null}
{"sheet": "test", "col": "A", "row": "", "longname": "type-currency", "input": "", "keystrokes": "$", "comment": "set type of current column to currency"}
{"sheet": "test", "col": "A", "row": "", "longname": "addcol-new", "input": "B", "keystrokes": "za", "comment": "append an empty column"}
{"sheet": "test", "col": "B", "row": "", "longname": "type-int", "input": "", "keystrokes": "#", "comment": "set type of current column to int"}
{"sheet": "test", "col": "B", "row": "", "longname": "addcol-expr", "input": "A/B", "keystrokes": "=", "comment": "create new column from Python expression, with column names as variables"}
{"sheet": "test", "col": "A/B", "row": "", "longname": "type-currency", "input": "", "keystrokes": "$", "comment": "set type of current column to currency"}
{"sheet": "test", "col": "", "row": "", "longname": "add-row", "input": "", "keystrokes": "a", "comment": "append a blank row"}
{"sheet": "test", "col": "A", "row": "0", "longname": "edit-cell", "input": "1.00", "keystrokes": "e", "comment": "edit contents of current cell"}
{"sheet": "test", "col": "B", "row": "0", "longname": "edit-cell", "input": "3", "keystrokes": "e", "comment": "edit contents of current cell"}
{"sheet": "test", "col": "", "row": "", "longname": "transpose", "input": "", "keystrokes": "Shift+T", "comment": "open new sheet with rows and columns transposed"}

Expected result

Cells should keep the same type and format as the source column.

Configuration

  • Does this issue reproduce without any plugins or configuration (using the -N CLI flag)? Yes

  • Does this issue reproduce with either the latest release, or with the develop branch? Yes on latest release (3.1.1). Didn't check develop branch.

Additional context

  • What platform and version are you using (Linux, MacOS, Windows)? Linux, NixOS

  • Which version of Python? 3.12

  • Which terminal are you using (for display and input issues)? Kitty

@pacien pacien added the bug label Oct 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant