You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I totally missed this PR #7417 which apparently got reverted here #7523. Interesting. Looks like I'm doing much of the same but perhaps not as nice. :)
Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
cargo test --workspace to check that all tests pass
Note
from nushell you can also use the toolkit as follows
use toolkit.nu # or use an `env_change` hook to activate it automatically
toolkit check pr
After Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.
This feels a bit like eval-lite :) Something I was wondering about is if we support things like $foo.$bar in the future and use $bar as where we get the path from, would it break in this case? Same as we make paths more advanced, like being able to add searches to them $foo.[name == 'bar*'] etc. Like it works fine for now, just thinking ahead a bit and wondering if future changes we do (like Riley's recent ? syntax) might make this one tricky.
I've been trying to get lex and parse_cell_path functions hooked up so the cell path can be parsed properly but I'm just running into dead ends everywhere.
Kubouch's comment here is relevant if you try to incorporate the parser at runtime on the string, it is very much eval-lite given you'd have to be able to follow variables at a minimum for it to be useful, and it gets worse when you get subexpressions like jt mentioned, so something like [name == $var] if it ever does land. I'm not super knowledgeable on nushell's parser, but that's the impression it left on me. Maybe into cellpath will have to be restricted to "static" paths that have all of their context inside the source string.
Looks like this won't be happening. IMO, it's helpful to users as was #7417. Others disagree. The best work-able solution I heard about it was somehow changing the parser to allow cell-path literals but I'm not sure that'll ever see the light of day either.
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
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 PR is an attempt to allow you to specify cell-paths as strings and convert them for usage.
Example 1 - Working now
Example 2 - Working now
Example 3 (still doesn't work - is '1' a cell-path in this example? The rest (a.b.c) are columns, but 1 is a row-index.)
closes #6597
closes #8466
User-Facing Changes
I totally missed this PR #7417 which apparently got reverted here #7523. Interesting. Looks like I'm doing much of the same but perhaps not as nice. :)
Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspaceto check that all tests passAfter Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.