Skip to content

Mutation of $env using cell paths doesn't seem to work #7110

Description

@sophiajt

Describe the bug

$env.config.max_history_size = 20000 should update the max_history_size in the config field.

This currently doesn't work correctly.

How to reproduce

See above

Expected behavior

$env.config.max_history_size = 20000 should set the deeper value without issue.

Screenshots

No response

Configuration

key value
version 0.71.1
branch main
commit_hash b650d1e
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.63.0 (4b91a6ea7 2022-08-08)
rust_channel 1.63.0-x86_64-pc-windows-msvc
cargo_version cargo 1.63.0 (fd9c4297c 2022-07-01)
pkg_version 0.71.1
build_time 2022-11-11 21:00:30 +13:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. added
    category:bug
    A:configuration
    on Nov 12, 2022
  2. webbedspace commented on Nov 16, 2022

    @webbedspace
    Contributor

    Hold on, does any mutation via cell paths actually work?

    〉let a = [[[1] [2] [3]] [[1] [2] [3]]]
    〉$a
    ╭───┬────────────────╮
    │ 0 │ [list 3 items] │
    │ 1 │ [list 3 items] │
    ╰───┴────────────────╯
    〉$a.0.0
    ╭───┬───╮
    │ 0 │ 1 │
    ╰───┴───╯
    〉$a.0.0 = 4
    Error: nu::parser::parse_mismatch (link)
    
      × Parse mismatch during operation.
       ╭─[entry #9:1:1]
     1 │ $a.0.0 = 4
       ·        ┬
       ·        ╰── expected operator
       ╰────
    
    
  3. webbedspace commented on Nov 19, 2022

    @webbedspace
    Contributor

    UPDATE: Nevermind, I figured it out, you mean with that new mut doohicky, right.

  4. Kangaxx-0 commented on Nov 23, 2022

    @Kangaxx-0
    Contributor

    Seems like max_history_size is an int which can not be converted to Record

  5. webbedspace commented on Nov 23, 2022

    @webbedspace
    Contributor

    Ignore the specifics of the example in the top post; the config structure changed recently so it's not necessarily still valid.

  6. Kangaxx-0 commented on Nov 27, 2022

    @Kangaxx-0
    Contributor

    I do not think the recent config refactoring is the root cause of this issue, taking $env.config.max_history_size = 20000 for example, the part of 20000 is an Int, but merge_env expects all configs to be Records, also, the evaluation phase is not handling Assign operator 100% correct. I will bring up this to discord for further discussion.

  7. added a commit that references this issue on Dec 6, 2022
    9b41f9e
  8. added this to the v0.73 milestone on Dec 7, 2022
  9. added a commit that references this issue on Dec 10, 2022
    ce78817
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:configurationcategory:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions