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