Use record API in more parts of nu-protocol#10928
Merged
sholderbach merged 6 commits intonushell:mainfrom Nov 8, 2023
Merged
Conversation
This breaks two tests Using `Record::remove` assumes that the keys are all unique. The current implementation since nushell#8446 uses the less efficient way of going over the whole record with `.retain` to deal with repeated keys. Culprit in the example is the table literal
This is required if `Record` only exposes a `Columns` iterator. This helper is only lightly used. Dealing with the non `Value::Record` case is a bit ugly, with the `impl Iterator` erasure some optimizations like `DoubleEndedIterator`/`TrustedLen` become unavailable. For now cloned in a few places.
hardfau1t
pushed a commit
to hardfau1t/nushell
that referenced
this pull request
Dec 14, 2023
# Description This is pretty complementary/orthogonal to @IanManske 's changes to `Value` cellpath accessors in: - nushell#10925 - to a lesser extent nushell#10926 ## Steps - Use `R.remove` in `Value.remove_data_at_cell_path` - Pretty sound after nushell#10875 (tests mentioned in commit message have been removed by that) - Update `did_you_mean` helper to use iterator - Change `Value::columns` to return iterator - This is not a place of honor - Use `Record::get` in `Value::get_data_by_key` # User-Facing Changes None intentional, potential edge cases on duplicated columns could change (considered undefined behavior) # Tests + Formatting (-)
dmatos2012
pushed a commit
to dmatos2012/nushell
that referenced
this pull request
Feb 20, 2024
# Description This is pretty complementary/orthogonal to @IanManske 's changes to `Value` cellpath accessors in: - nushell#10925 - to a lesser extent nushell#10926 ## Steps - Use `R.remove` in `Value.remove_data_at_cell_path` - Pretty sound after nushell#10875 (tests mentioned in commit message have been removed by that) - Update `did_you_mean` helper to use iterator - Change `Value::columns` to return iterator - This is not a place of honor - Use `Record::get` in `Value::get_data_by_key` # User-Facing Changes None intentional, potential edge cases on duplicated columns could change (considered undefined behavior) # Tests + Formatting (-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is pretty complementary/orthogonal to @IanManske 's changes to
Valuecellpath accessors in:Record::getinstead ofValuefunctions #10925Value::follow_cell_path_not_from_user_input#10926Steps
R.removeinValue.remove_data_at_cell_pathdid_you_meanhelper to use iteratorValue::columnsto return iteratorRecord::getinValue::get_data_by_keyUser-Facing Changes
None intentional, potential edge cases on duplicated columns could change (considered undefined behavior)
Tests + Formatting
(-)