Multiline terminal command isn't processed properly
See original GitHub issueI’ve included two notebooks, which are identical except for the terminal command.
- one with a single-line terminal command
! bq --location=US load --autodetect --skip_leading_rows=1 --source_format=CSV {dataset_id}.us_states_local_file 'resources/us-states.csv'
- one with a multi-line terminal command
!bq \
--location=US load \
--autodetect \
--skip_leading_rows=1 \
--source_format=CSV \
{dataset_id}.us_states_local_file \
'resources/us-states.csv'
The one with multiline doesn’t process properly, so when I run nbqa with black
, I get:
Running black...
error: cannot format notebooks/official/bigquery_command_line_tool.ipynb: Cannot parse: cell_6:2:5: --lo 0x6AA55214
Issue Analytics
- State:
- Created 2 years ago
- Comments:12
Top Results From Across the Web
Terminal prompt not wrapping correctly - Unix Stack Exchange
I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly....
Read more >Linux Bash Script, Single Command But Multiple Lines?
This works, but I am wondering if I can format the script to show the command over multiple lines, something like this, so...
Read more >Unable to recognize multiline command · Issue #49 - GitHub
Hi, I have the following command that is not working in Powershell 7.0.3 (Windows10, Visual Studio Code terminal).
Read more >multi line variable does not work for parameters when used in ...
I have a script that is used to set up a couple default widgets on a wordpress site through wp-cli. script widgets.sh: read...
Read more >multiline command chunks in bash history into multiple lines
bash_history has chucked the command on multiple separate entries and writing problem here; the history command result messed too.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As an aside, seeing as you’re using
nbQA
at Google, I’d appreciate it if you could consider sponsoring the projectOK, I see what’s happened - you’re missing the extra Jupyter requirements when running black on the notebooks, and so they’re been formatted as if they were Python files. You probably ran
black
on the notebooks when the version was still20.8b1
, right?If you want Jupyter support for
black
, you need to install it asI’d advise:
pip install -U black[jupyter]
black
on the notebooksThe previous commit was fine btw (https://github.com/GoogleCloudPlatform/bigquery-notebooks/commit/56712e9a7f57c3acd047ae011fa98b8283c0611e)