Skip to content

Can not create a table literal for an empty table #19320

Open

Description

@bilberry-work

Bug report form

  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.

Describe the bug

I needed to write literal syntax to create table. The parser does not permit this.

How to reproduce

eg

let x = [
    [to-relative_folder-path from-multicall-binary-file-name install-list-to-file-names];
]

parser produces:

Error: nu::parser::parse_mismatch

  × Parse mismatch: expected table row.
   ╭─[repl_entry #1:2:90]
 1 │ let x = [
 2 │     [to-relative_folder-path from-multicall-binary-file-name install-list-to-file-names];
   ·                                                                                          ▲
   ·                                                                                          ╰── expected table row
 3 │ ]
   ╰────
  help: Check the syntax around this position — a typo, missing delimiter, or wrong separator is common.

Expected behavior

x has a table with no rows.

Configuration

key value
version 0.116.1
major 0
minor 116
patch 1
branch
commit_hash b632ef0
build_os macos-aarch64
build_target x86_64-apple-darwin
rust_version rustc 1.96.1 (31fca3adb 2026-06-26)
rust_channel 1.96.1-aarch64-apple-darwin
cargo_version cargo 1.96.1 (356927216 2026-06-26)
build_time 2026-10-04 14:47:05 +00:00
build_rust_channel release
allocator standard
features dap, default, lsp, mcp, network, plugin, rustls-tls, sqlite, static-link-openssl, trash-support
installed_plugins
experimental_options example=false, dc-glob=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=true, native-clip=false, cell-path-types=false

Activity

  1. added
    status:needs-triage
    on Oct 23, 2026
  2. fdncred commented on Oct 23, 2026

    @fdncred
    Contributor

    why would it allow you to create a table with no rows? It says that it expects rows.

  3. youk commented on Oct 24, 2026

    @youk

    Nushell has its own conception of "empty". See for example #903 (comment).

  4. fdncred commented on Oct 24, 2026

    @fdncred
    Contributor

    but what's the point/use case of creating an empty table?

  5. bilberry-work commented on Oct 24, 2026

    @bilberry-work
    Author

    @fdncred Plenty!

    I have two current scenarios:-

    1. I need to dynamically append rows to a table, as nushell does not permit me to create a table literal with rows generated by custom commands AFAIK.
    2. I need to create a compelx literal, one of whose fields is defined as a table. However, there are no rows in this casse, eg
    
    	let package_details = {
    		url: {
    			host: github.com
    			path: {|toolchain, archive_extract_strategy: string@$ArchiveExtractStrategy|
    				$'/nushell/nushell/releases/download/($package_version)/(file-stem $toolchain).(archive-extract-strategy-to-primary-file-extension $archive_extract_strategy)'
    			}
    		}
    		archive-extract-strategy: {
    			darwin: tar-gzip
    			linux: tar-gzip
    			windows: zip
    		}
    		sha256-download-file-hashes: $download_file_sha256_hashes
    		extract-relative-folder-path: {|toolchain|
    			file-stem $toolchain
    		}
    		install: {
    			files: [
    				[from-relative-file-path to-relative-file-path executable];
    				[$PackageName $'bin/($PackageName)' true]
    			]
    			multicall-binaries: THIS_NEEDS_TO_BE_AN_EMPTY_TABLE
    		}
    	}
    
        return { x: 'y', a: 56, package-details: $package-details } <=  Function return signature requires the package-details.install.multicall-binaries fields to be a table.
    
    

    And, more importantly, consistency.

  6. bilberry-work commented on Oct 24, 2026

    @bilberry-work
    Author

    @youk I see in that thread that an empty table is defined identically to an empty list. That's … not nice. Now that nushell is starting to have types, that just seems wrong.

  7. fdncred commented on Oct 24, 2026

    @fdncred
    Contributor

    A table is a list of records, that's it.

  8. youk commented on Oct 24, 2026

    @youk

    Is table a type?

  9. fdncred commented on Oct 24, 2026

    @fdncred
    Contributor

    It's never been finished. So, yes it's a type but it's incomplete. Even if it were a type, it would still be a list of records.

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

    status:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions