Skip to content

Commit dc40ec2

Browse files
Merge branch 'main' into SNOW-2203079-HTTP-traffic-without-interception-with-adapter
2 parents 8ebdc95 + 2d8a795 commit dc40ec2

File tree

9 files changed

+292
-358
lines changed

9 files changed

+292
-358
lines changed

DESCRIPTION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
1919
- Added basic json support for Interval types.
2020
- Moved `OAUTH_TYPE` to `CLIENT_ENVIROMENT`.
2121
- Fix bug where PAT with external session authenticator was used while `external_session_id` was not provided in `SnowflakeRestful.fetch`
22+
- Added support for parameter `use_vectorized_scanner` in function `write_pandas`.
2223

2324
- v3.16.0(July 04,2025)
2425
- Bumped numpy dependency from <2.1.0 to <=2.2.4.

src/snowflake/connector/connection.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,13 +1339,21 @@ def __open_connection(self):
13391339
)
13401340
elif self._authenticator == WORKLOAD_IDENTITY_AUTHENTICATOR:
13411341
self._check_experimental_authentication_flag()
1342-
# Standardize the provider enum.
1343-
if self._workload_identity_provider and isinstance(
1344-
self._workload_identity_provider, str
1345-
):
1342+
1343+
if isinstance(self._workload_identity_provider, str):
13461344
self._workload_identity_provider = AttestationProvider.from_string(
13471345
self._workload_identity_provider
13481346
)
1347+
if not self._workload_identity_provider:
1348+
Error.errorhandler_wrapper(
1349+
self,
1350+
None,
1351+
ProgrammingError,
1352+
{
1353+
"msg": f"workload_identity_provider must be set to one of {','.join(AttestationProvider.all_string_values())} when authenticator is WORKLOAD_IDENTITY.",
1354+
"errno": ER_INVALID_WIF_SETTINGS,
1355+
},
1356+
)
13491357
self.auth_class = AuthByWorkloadIdentity(
13501358
provider=self._workload_identity_provider,
13511359
token=self._token,
@@ -1500,7 +1508,10 @@ def __config(self, **kwargs):
15001508
self,
15011509
None,
15021510
ProgrammingError,
1503-
{"msg": "User is empty", "errno": ER_NO_USER},
1511+
{
1512+
"msg": f"User is empty, but it must be provided unless authenticator is one of {', '.join(empty_user_allowed_authenticators)}.",
1513+
"errno": ER_NO_USER,
1514+
},
15041515
)
15051516

15061517
if self._private_key or self._private_key_file:

src/snowflake/connector/pandas_tools.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def write_pandas(
261261
use_logical_type: bool | None = None,
262262
iceberg_config: dict[str, str] | None = None,
263263
bulk_upload_chunks: bool = False,
264+
use_vectorized_scanner: bool = False,
264265
**kwargs: Any,
265266
) -> tuple[
266267
bool,
@@ -308,6 +309,8 @@ def write_pandas(
308309
on_error: Action to take when COPY INTO statements fail, default follows documentation at:
309310
https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#copy-options-copyoptions
310311
(Default value = 'abort_statement').
312+
use_vectorized_scanner: Boolean that specifies whether to use a vectorized scanner for loading Parquet files. See details at
313+
`copy options <https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#copy-options-copyoptions>`_.
311314
parallel: Number of threads to be used when uploading chunks, default follows documentation at:
312315
https://docs.snowflake.com/en/sql-reference/sql/put.html#optional-parameters (Default value = 4).
313316
quote_identifiers: By default, identifiers, specifically database, schema, table and column names
@@ -579,6 +582,7 @@ def drop_object(name: str, object_type: str) -> None:
579582
f"FROM (SELECT {parquet_columns} FROM '{copy_stage_location}') "
580583
f"FILE_FORMAT=("
581584
f"TYPE=PARQUET "
585+
f"USE_VECTORIZED_SCANNER={use_vectorized_scanner} "
582586
f"COMPRESSION={compression_map[compression]}"
583587
f"{' BINARY_AS_TEXT=FALSE' if auto_create_table or overwrite else ''}"
584588
f"{sql_use_logical_type}"

0 commit comments

Comments
 (0)