|
120 | 120 |
|
121 | 121 | DEFAULT_CLIENT_PREFETCH_THREADS = 4
|
122 | 122 | MAX_CLIENT_PREFETCH_THREADS = 10
|
| 123 | +MAX_CLIENT_FETCH_THREADS = 1024 |
123 | 124 | DEFAULT_BACKOFF_POLICY = exponential_backoff()
|
124 | 125 |
|
125 | 126 |
|
@@ -222,6 +223,7 @@ def _get_private_bytes_from_file(
|
222 | 223 | (type(None), int),
|
223 | 224 | ), # snowflake
|
224 | 225 | "client_prefetch_threads": (4, int), # snowflake
|
| 226 | + "client_fetch_threads": (None, (type(None), int)), |
225 | 227 | "numpy": (False, bool), # snowflake
|
226 | 228 | "ocsp_response_cache_filename": (None, (type(None), str)), # snowflake internal
|
227 | 229 | "converter_class": (DefaultConverterClass(), SnowflakeConverter),
|
@@ -380,6 +382,7 @@ class SnowflakeConnection:
|
380 | 382 | See the backoff_policies module for details and implementation examples.
|
381 | 383 | client_session_keep_alive_heartbeat_frequency: Heartbeat frequency to keep connection alive in seconds.
|
382 | 384 | client_prefetch_threads: Number of threads to download the result set.
|
| 385 | + client_fetch_threads: Number of threads to fetch staged query results. |
383 | 386 | rest: Snowflake REST API object. Internal use only. Maybe removed in a later release.
|
384 | 387 | application: Application name to communicate with Snowflake as. By default, this is "PythonConnector".
|
385 | 388 | errorhandler: Handler used with errors. By default, an exception will be raised on error.
|
@@ -639,6 +642,16 @@ def client_prefetch_threads(self, value) -> None:
|
639 | 642 | self._client_prefetch_threads = value
|
640 | 643 | self._validate_client_prefetch_threads()
|
641 | 644 |
|
| 645 | + @property |
| 646 | + def client_fetch_threads(self) -> int | None: |
| 647 | + return self._client_fetch_threads |
| 648 | + |
| 649 | + @client_fetch_threads.setter |
| 650 | + def client_fetch_threads(self, value: None | int) -> None: |
| 651 | + if value is not None: |
| 652 | + value = min(max(1, value), MAX_CLIENT_FETCH_THREADS) |
| 653 | + self._client_fetch_threads = value |
| 654 | + |
642 | 655 | @property
|
643 | 656 | def rest(self) -> SnowflakeRestful | None:
|
644 | 657 | return self._rest
|
|
0 commit comments