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
{{ message }}
Repository navigation
pick doens't produce error messages when given an invalid column name #750
I'd like to take a crack at this, if I may? Fair warning though, I'm new to this code base :)
At the moment pick sees "Nothing" as a completely valid response every time it runs select_fields, which is why the table with empty rows gets printed.
I'm struggling to see where to add the error checking code.
As far as I can see pick calls select_fields() which returns an InputStream.
My difficulty is that select_fields doesn't return a Result, and an InputStream is, on the surface, difficult to inspect.
Inside select_fields() when matching None, a Primitive::Nothing is used by way of Value::nothing(). This might be the place to try and return errors? Err("Nothing selected") or thereabouts :)
There may be a reason a Primitive::Nothing is returned by select_fields(), but if everything that should allow a Primitive::Nothing from select_fields is able to match the Err and opt to return Primitive::Nothing themselves then we'd be good, if that's not too burdensome!
Activity
andrasio commentedon Oct 31, 2019
@boxed Thanks for reporting it!
andrasio commentedon Nov 2, 2019
#900
drmason13 commentedon Nov 7, 2019
I'd like to take a crack at this, if I may? Fair warning though, I'm new to this code base :)
At the moment pick sees "Nothing" as a completely valid response every time it runs
select_fields, which is why the table with empty rows gets printed.I'm struggling to see where to add the error checking code.
As far as I can see
pickcallsselect_fields()which returns anInputStream.My difficulty is that
select_fieldsdoesn't return aResult, and anInputStreamis, on the surface, difficult to inspect.Inside
select_fields()when matchingNone, aPrimitive::Nothingis used by way ofValue::nothing(). This might be the place to try and return errors?Err("Nothing selected")or thereabouts :)There may be a reason a
Primitive::Nothingis returned byselect_fields(), but if everything that should allow aPrimitive::Nothingfromselect_fieldsis able to match the Err and opt to returnPrimitive::Nothingthemselves then we'd be good, if that's not too burdensome!boxed commentedon Nov 19, 2019
Was this fixed?
andrasio commentedon Nov 19, 2019
@boxed Not yet. We are tracking it from #900 now to avoid having so many open issues.
boxed commentedon Nov 19, 2019
Now you're just making me confused! :)
andrasio commentedon Nov 19, 2019
@boxed Heh, we decided to reopen them and track them in the meta-issue.
boxed commentedon Jan 7, 2020
🎉
Save (nushell#750)
Save (#750)