Skip to content

Commit dda163f

Browse files
committed
use os.path.split to make sure it works on windows as well
1 parent fb12df2 commit dda163f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/snowflake/connector/direct_file_operation_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
if TYPE_CHECKING:
66
from .connection import SnowflakeConnection
77

8+
import os
89
from abc import ABC, abstractmethod
910

1011
from .constants import CMD_TYPE_UPLOAD
@@ -62,8 +63,8 @@ def parse_file_operation(
6263

6364
if command_type == CMD_TYPE_UPLOAD:
6465
if has_source_from_stream:
65-
stage_location, unprefixed_local_file_name = stage_location.rsplit(
66-
"/", maxsplit=1
66+
stage_location, unprefixed_local_file_name = os.path.split(
67+
stage_location
6768
)
6869
local_file_name = "file://" + unprefixed_local_file_name
6970
sql = f"PUT {local_file_name} ? {options_in_sql}"

0 commit comments

Comments
 (0)