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
You can't use query web --as-table without --query any more. The command in the examples break.
How to reproduce
Get latest nightly nushell, run the sample command from query web -h, which is http get https://en.wikipedia.org/wiki/List_of_cities_in_India_by_population | query web --as-table [City 'Population(2011)[3]' 'Population(2001)[3][a]' 'State or unionterritory' 'Ref'].
I think the bug is also in 0.92. I locked my environment in 0.91, due to errors when upgrading nushell to run my scripts. Finally got time to look into the details.
I've fixed this example many times. Typically, what happens is that the Wikipedia page changes slightly so the column names aren't the same anymore. I'm not sure if that's what is going on now, but that's usually what it is.
I think @devyn changed this code last by rewriting some errors, so something could've been introduced there too?
Nope, it's not related to Wikipedia page. Same command works in nushell 0.91. It's command parsing error since 0.92.
Wikipedia page is not the root cause for this ticket. But I will suggest maybe use nushell governed web page as example, if that Wikipedia page changes too oftem.
Activity
wdv4758h commentedon Apr 28, 2024
Probably this part:
nushell/crates/nu_plugin_query/src/query_web.rs
Lines 123 to 133 in 01d30a4
It forces the command to use
--queryflag, which is not the case in example or previous versions.wdv4758h commentedon Apr 28, 2024
I think the bug is also in 0.92. I locked my environment in 0.91, due to errors when upgrading nushell to run my scripts. Finally got time to look into the details.
[-]query web table parse breaks [/-][+]query web `--as-table` breaks (since 0.92)[/+]fdncred commentedon Apr 28, 2024
I've fixed this example many times. Typically, what happens is that the Wikipedia page changes slightly so the column names aren't the same anymore. I'm not sure if that's what is going on now, but that's usually what it is.
I think @devyn changed this code last by rewriting some errors, so something could've been introduced there too?
wdv4758h commentedon Apr 28, 2024
Nope, it's not related to Wikipedia page. Same command works in nushell 0.91. It's command parsing error since 0.92.
Wikipedia page is not the root cause for this ticket. But I will suggest maybe use nushell governed web page as example, if that Wikipedia page changes too oftem.
fdncred commentedon Apr 28, 2024
Yup, I think @devyn broke this by adding the
elsestatement. I just put up a PR to fix it. No biggy. Accidents happen.fdncred commentedon Apr 28, 2024
Still works (after #12693). Yay! At least it wasn't Wikipedia this time.

devyn commentedon Apr 28, 2024
Whoops, sorry about that. Guess I didn't read carefully enough. It would be good to add some tests, now that that's easy to do.
restore `query web --as-table` to working order (#12693)
restore `query web --as-table` to working order (nushell#12693)