|
128 | 128 |
|
129 | 129 | DEFAULT_CLIENT_PREFETCH_THREADS = 4
|
130 | 130 | MAX_CLIENT_PREFETCH_THREADS = 10
|
| 131 | +MAX_CLIENT_FETCH_THREADS = 1024 |
131 | 132 | DEFAULT_BACKOFF_POLICY = exponential_backoff()
|
132 | 133 |
|
133 | 134 |
|
@@ -231,6 +232,7 @@ def _get_private_bytes_from_file(
|
231 | 232 | (type(None), int),
|
232 | 233 | ), # snowflake
|
233 | 234 | "client_prefetch_threads": (4, int), # snowflake
|
| 235 | + "client_fetch_threads": (None, (type(None), int)), |
234 | 236 | "numpy": (False, bool), # snowflake
|
235 | 237 | "ocsp_response_cache_filename": (None, (type(None), str)), # snowflake internal
|
236 | 238 | "converter_class": (DefaultConverterClass(), SnowflakeConverter),
|
@@ -420,6 +422,7 @@ class SnowflakeConnection:
|
420 | 422 | See the backoff_policies module for details and implementation examples.
|
421 | 423 | client_session_keep_alive_heartbeat_frequency: Heartbeat frequency to keep connection alive in seconds.
|
422 | 424 | client_prefetch_threads: Number of threads to download the result set.
|
| 425 | + client_fetch_threads: Number of threads to fetch staged query results. |
423 | 426 | rest: Snowflake REST API object. Internal use only. Maybe removed in a later release.
|
424 | 427 | application: Application name to communicate with Snowflake as. By default, this is "PythonConnector".
|
425 | 428 | errorhandler: Handler used with errors. By default, an exception will be raised on error.
|
@@ -684,6 +687,16 @@ def client_prefetch_threads(self, value) -> None:
|
684 | 687 | self._client_prefetch_threads = value
|
685 | 688 | self._validate_client_prefetch_threads()
|
686 | 689 |
|
| 690 | + @property |
| 691 | + def client_fetch_threads(self) -> int | None: |
| 692 | + return self._client_fetch_threads |
| 693 | + |
| 694 | + @client_fetch_threads.setter |
| 695 | + def client_fetch_threads(self, value: None | int) -> None: |
| 696 | + if value is not None: |
| 697 | + value = min(max(1, value), MAX_CLIENT_FETCH_THREADS) |
| 698 | + self._client_fetch_threads = value |
| 699 | + |
687 | 700 | @property
|
688 | 701 | def rest(self) -> SnowflakeRestful | None:
|
689 | 702 | return self._rest
|
|
0 commit comments