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
When working on #424, I realized we have an error when parsing the arguments passed to the SQL query (e.g., %sql SELECT * FROM table --persist - note that we have to parse the query and the --persist argument).
This is because we're relying on parse_argstring from IPython, which behaves differently on Windows and will delete quotes that are necessary for a SQL query to run, here's how to reproduce it.
Using either double or single quote to enclose a space when using %sql, %sqlplot, or %sqlcmd should work. (e.g %sql create table "table spaces" (n INT), %sqlplot bar --table 'file with spaces.csv' --column x, or %sqlcmd columns -t 'table with spaces' should work)
When working on #424, I realized we have an error when parsing the arguments passed to the SQL query (e.g.,
%sql SELECT * FROM table --persist
- note that we have to parse the query and the--persist
argument).This is because we're relying on
parse_argstring
from IPython, which behaves differently on Windows and will delete quotes that are necessary for a SQL query to run, here's how to reproduce it.Console output (1/1):
We're using this function internally to parse arguments, note that the query has
"table spaces"
in double quote:On Windows, the double quotes disappear (this doesn't happen on mac or linux):
Console output (1/1):
This happens because on linux/mac, the
_process_common
function is used:Console output (1/1):
But on Windows, the
_process_win32
is used:Console output (1/1):
I think we can fix this by changing our
magic_args
function inparse.py
:But I'm unsure if there would be any side effects.
Some IPython links:
https://github.com/ipython/ipython/blob/a3d5a06d9948260a6b08c622e86248f48afd66c3/IPython/utils/_process_win32.py#L29
https://github.com/ipython/ipython/blob/a3d5a06d9948260a6b08c622e86248f48afd66c3/IPython/utils/_process_common.py#L25
https://github.com/ipython/ipython/blob/a3d5a06d9948260a6b08c622e86248f48afd66c3/IPython/core/magic_arguments.py#L164
The text was updated successfully, but these errors were encountered: