Skip to content

Commit a42d021

Browse files
fix(kernel): recognize streaming PUT after a closing quote
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
1 parent fb2ef00 commit a42d021

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/databricks/sql/backend/kernel/client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def execute_command(
563563
stripped_sql = _strip_leading_sql_comments(operation)
564564
staging_verb = _staging_verb(stripped_sql)
565565
if re.match(
566-
r"""PUT\s*(['"])__input_stream__\1(?:\s|$)""",
566+
r"""PUT\s*(['"])__input_stream__\1""",
567567
stripped_sql,
568568
re.IGNORECASE,
569569
):

‎tests/unit/test_kernel_client.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,8 @@ def test_staging_verb_matches_only_the_leading_statement(operation, expected):
932932
"query",
933933
[
934934
"PUT '__input_stream__' INTO '/Volumes/c/s/v/file'",
935+
"PUT '__input_stream__'INTO '/Volumes/c/s/v/file'",
936+
'PUT"__input_stream__"INTO "/Volumes/c/s/v/file"',
935937
"/* upload */ PUT '__input_stream__' INTO '/Volumes/c/s/v/file'",
936938
"PUT'__input_stream__' INTO '/Volumes/c/s/v/file'",
937939
"/* upload */ PUT\"__input_stream__\" INTO '/Volumes/c/s/v/file'",

0 commit comments

Comments
 (0)