Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/snowflake/connector/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ def _get_private_bytes_from_file(
str,
# SNOW-2096721: External (Spark) session ID
),
"unsafe_file_write": (
False,
bool,
), # SNOW-1944208: add unsafe write flag
_VARIABLE_NAME_SERVER_DOP_CAP_FOR_FILE_TRANSFER: (
_DEFAULT_VALUE_SERVER_DOP_CAP_FOR_FILE_TRANSFER, # default value
int, # type
Expand Down Expand Up @@ -1410,11 +1414,6 @@ def __config(self, **kwargs):
if "host" not in kwargs:
self._host = construct_hostname(kwargs.get("region"), self._account)

if "unsafe_file_write" in kwargs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a quick test that by default our driver behaves in the way that unsafe_file_write = False describes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, then we are good 👍

I found the second test before, but I think we set there explicitly the value to True so it wasn't preventing changes in the default behaviour in the future.

Nevertheless, the first test You attached is what I needed indeed.

self._unsafe_file_write = kwargs["unsafe_file_write"]
else:
self._unsafe_file_write = False

logger.info(
f"Connecting to {_DOMAIN_NAME_MAP.get(extract_top_level_domain_from_hostname(self._host), 'GLOBAL')} Snowflake domain"
)
Expand Down
Loading