Skip to content

Commit ffff3e6

Browse files
committed
potential test improvement and more debug assert
1 parent 989952b commit ffff3e6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/snowflake/connector/direct_file_operation_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def parse_file_operation(
7878
ret = cursor._execute_helper(
7979
sql, binding_params=processed_params, is_internal=True
8080
)
81-
assert ret.get("success", False), f"parse failed, ret is {ret}"
81+
assert ret.get(
82+
"success", False
83+
), f"parse failed, ret is {ret}, local_file_name is {local_file_name}, stage_location is {stage_location}"
8284
return ret
8385

8486

test/integ/test_direct_file_operation_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
def _normalize_windows_local_path(path):
26-
return path.replace("\\", "\\\\")
26+
return path.replace("\\", "\\\\").replace("'", "\\'")
2727

2828

2929
def _validate_upload_content(
@@ -96,7 +96,7 @@ def test_upload(
9696
):
9797
def upload_task(cursor, stage_name, temp_dir, base_file_name):
9898
cursor._upload(
99-
local_file_name=f"file://{_normalize_windows_local_path(os.path.join(temp_dir, base_file_name))}",
99+
local_file_name=f"'file://{_normalize_windows_local_path(os.path.join(temp_dir, base_file_name))}'",
100100
stage_location=f"@{stage_name}",
101101
options={"auto_compress": is_compressed},
102102
)

0 commit comments

Comments
 (0)