Skip to content

[0.83.1] format is broken for (probably?) manually constructed records #9897

Closed

Description

@tminich

Describe the bug

format refuses to accept manually constructed records with (eg)

  × Command does not support record<name: string> input.
   ╭─[entry #12:1:1]
 1 │ {name: "Downloads"} | format "{name}"
   ·                       ───┬──
   ·                          ╰── command doesn't support record<name: string> input
   ╰────

How to reproduce

[WSL: Ubuntu-22.04] ~
nu ➯ ls | get 0 | describe
record<name: string, type: string, size: filesize, modified: date>

[WSL: Ubuntu-22.04] ~
nu ➯ ls | get 0 | format "{name}"
Downloads

[WSL: Ubuntu-22.04] ~
nu ➯ {name: "Downloads"} | describe
record<name: string>

[WSL: Ubuntu-22.04] ~
nu ➯ {name: "Downloads"} | format "{name}"
Error: nu::parser::input_type_mismatch

  × Command does not support record<name: string> input.
   ╭─[entry #12:1:1]
 1 │ {name: "Downloads"} | format "{name}"
   ·                       ───┬──
   ·                          ╰── command doesn't support record<name: string> input
   ╰────

Something's wrong here :)
(Worked fine in 0.82.0)

Expected behavior

It working like before and like it does with records from internal commands.

Screenshots

No response

Configuration

key value
version 0.83.1
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.70.0 (90c541806 2023-05-31) (built from a source tarball)
cargo_version cargo 1.70.0
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator standard
features dataframe, default, extra, sqlite, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. added
    status:needs-triage
    on Aug 2, 2023
  2. added
    A:type-system
    and removed
    status:needs-triage
    on Aug 2, 2023
  3. added a commit that references this issue on Aug 2, 2023
    ec4941c
  4. added this to the v0.84.0 milestone on Aug 2, 2023
  5. added a commit that references this issue on Aug 3, 2023
    1c98932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:type-system

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions