snowflake-connector-python 5.2.0__cp315-cp315-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. snowflake/connector/__init__.py +148 -0
  2. snowflake/connector/_common/__init__.py +0 -0
  3. snowflake/connector/_common/extras.py +134 -0
  4. snowflake/connector/_common/telemetry.py +221 -0
  5. snowflake/connector/_common/wif_util.py +92 -0
  6. snowflake/connector/_core/sf_core_python.cp315-win_amd64.pyd +0 -0
  7. snowflake/connector/_core/sf_core_python.pyi +79 -0
  8. snowflake/connector/_internal/__init__.py +6 -0
  9. snowflake/connector/_internal/_private_key_helper.py +31 -0
  10. snowflake/connector/_internal/api_client/__init__.py +93 -0
  11. snowflake/connector/_internal/api_client/bridge.py +41 -0
  12. snowflake/connector/_internal/api_client/client_api.py +976 -0
  13. snowflake/connector/_internal/arrow.py +47 -0
  14. snowflake/connector/_internal/arrow_context.py +240 -0
  15. snowflake/connector/_internal/arrow_stream_async.py +266 -0
  16. snowflake/connector/_internal/arrow_stream_iterator.cp311-win_amd64.pyd +0 -0
  17. snowflake/connector/_internal/arrow_stream_iterator.cp312-win_amd64.pyd +0 -0
  18. snowflake/connector/_internal/arrow_stream_iterator.cp313-win_amd64.pyd +0 -0
  19. snowflake/connector/_internal/arrow_stream_iterator.cp314-win_amd64.pyd +0 -0
  20. snowflake/connector/_internal/arrow_stream_iterator.cp314t-win_amd64.pyd +0 -0
  21. snowflake/connector/_internal/arrow_stream_iterator.cp315-win_amd64.pyd +0 -0
  22. snowflake/connector/_internal/arrow_stream_iterator.pyi +42 -0
  23. snowflake/connector/_internal/arrow_stream_utils.py +171 -0
  24. snowflake/connector/_internal/authenticator_type.py +53 -0
  25. snowflake/connector/_internal/backward_compatibility.py +245 -0
  26. snowflake/connector/_internal/binding_converters.py +741 -0
  27. snowflake/connector/_internal/config_utils.py +71 -0
  28. snowflake/connector/_internal/connection/__init__.py +39 -0
  29. snowflake/connector/_internal/connection/connection.py +616 -0
  30. snowflake/connector/_internal/connection/connection_types.py +13 -0
  31. snowflake/connector/_internal/connection/constants.py +25 -0
  32. snowflake/connector/_internal/connection/decorators.py +31 -0
  33. snowflake/connector/_internal/connection/freezable_proxy.py +104 -0
  34. snowflake/connector/_internal/connection/queries.py +10 -0
  35. snowflake/connector/_internal/connection_config_mixin.py +755 -0
  36. snowflake/connector/_internal/cursor/__init__.py +25 -0
  37. snowflake/connector/_internal/cursor/base.py +732 -0
  38. snowflake/connector/_internal/cursor/cursor_types.py +13 -0
  39. snowflake/connector/_internal/cursor/decorators.py +56 -0
  40. snowflake/connector/_internal/cursor/query_result.py +202 -0
  41. snowflake/connector/_internal/cursor/query_result_waiter.py +98 -0
  42. snowflake/connector/_internal/cursor/result_metadata.py +255 -0
  43. snowflake/connector/_internal/cursor/result_set_wrapper.py +66 -0
  44. snowflake/connector/_internal/decorators.py +539 -0
  45. snowflake/connector/_internal/error_kinds.py +111 -0
  46. snowflake/connector/_internal/errorcode.py +35 -0
  47. snowflake/connector/_internal/errorhandler.py +278 -0
  48. snowflake/connector/_internal/fips.py +28 -0
  49. snowflake/connector/_internal/logging/__init__.py +52 -0
  50. snowflake/connector/_internal/logging/config.py +134 -0
  51. snowflake/connector/_internal/logging/core_logger.py +218 -0
  52. snowflake/connector/_internal/logging/native_extension_logger.py +144 -0
  53. snowflake/connector/_internal/logout_config_mapping.py +187 -0
  54. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ArrayConverter.cpp +57 -0
  55. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ArrayConverter.hpp +29 -0
  56. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ArrowTableConverter.cpp +943 -0
  57. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ArrowTableConverter.hpp +63 -0
  58. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/BinaryConverter.cpp +18 -0
  59. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/BinaryConverter.hpp +26 -0
  60. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/BooleanConverter.cpp +21 -0
  61. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/BooleanConverter.hpp +23 -0
  62. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/CArrowIterator.cpp +118 -0
  63. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/CArrowIterator.hpp +116 -0
  64. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/CArrowStreamIterator.cpp +323 -0
  65. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/CArrowStreamIterator.hpp +133 -0
  66. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/CArrowStreamTableIterator.cpp +275 -0
  67. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/CArrowStreamTableIterator.hpp +168 -0
  68. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ConverterUtil.cpp +439 -0
  69. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ConverterUtil.hpp +30 -0
  70. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/DateConverter.cpp +48 -0
  71. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/DateConverter.hpp +46 -0
  72. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/DecFloatConverter.cpp +76 -0
  73. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/DecFloatConverter.hpp +35 -0
  74. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/DecimalConverter.cpp +90 -0
  75. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/DecimalConverter.hpp +63 -0
  76. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.cpp +62 -0
  77. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.hpp +28 -0
  78. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/FloatConverter.cpp +29 -0
  79. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/FloatConverter.hpp +35 -0
  80. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/IColumnConverter.hpp +17 -0
  81. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/IntConverter.cpp +23 -0
  82. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/IntConverter.hpp +41 -0
  83. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/IntervalConverter.cpp +65 -0
  84. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/IntervalConverter.hpp +54 -0
  85. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/LICENSE.txt +209 -0
  86. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/MapConverter.cpp +79 -0
  87. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/MapConverter.hpp +30 -0
  88. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ObjectConverter.cpp +52 -0
  89. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/ObjectConverter.hpp +29 -0
  90. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/Python/Common.cpp +8 -0
  91. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/Python/Common.hpp +117 -0
  92. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/Python/Helpers.cpp +54 -0
  93. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/Python/Helpers.hpp +34 -0
  94. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/SnowflakeType.cpp +33 -0
  95. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/SnowflakeType.hpp +48 -0
  96. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/StringConverter.cpp +18 -0
  97. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/StringConverter.hpp +26 -0
  98. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/TimeConverter.cpp +39 -0
  99. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/TimeConverter.hpp +31 -0
  100. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/TimeStampConverter.cpp +326 -0
  101. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/TimeStampConverter.hpp +138 -0
  102. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/Util/macros.hpp +14 -0
  103. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/Util/time.cpp +65 -0
  104. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/Util/time.hpp +68 -0
  105. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/arrow_stream_iterator.cpp +13278 -0
  106. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/arrow_stream_iterator.pyx +204 -0
  107. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_accessors.h +109 -0
  108. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_alloc.h +125 -0
  109. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_assert.h +45 -0
  110. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_builder.h +1914 -0
  111. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_emitter.h +208 -0
  112. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_endian.h +128 -0
  113. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_epilogue.h +7 -0
  114. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_flatbuffers.h +58 -0
  115. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_identifier.h +144 -0
  116. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_iov.h +31 -0
  117. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_prologue.h +8 -0
  118. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_refmap.h +144 -0
  119. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_rtconfig.h +160 -0
  120. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_types.h +98 -0
  121. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_verifier.h +243 -0
  122. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/flatcc_portable.h +14 -0
  123. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/paligned_alloc.h +207 -0
  124. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pattributes.h +80 -0
  125. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic.h +83 -0
  126. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_pop.h +20 -0
  127. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_push.h +51 -0
  128. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian.h +201 -0
  129. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian_detect.h +108 -0
  130. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinline.h +19 -0
  131. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinttypes.h +52 -0
  132. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable.h +2 -0
  133. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable_basic.h +25 -0
  134. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstatic_assert.h +67 -0
  135. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdalign.h +164 -0
  136. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdint.h +926 -0
  137. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/punaligned.h +182 -0
  138. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pversion.h +6 -0
  139. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc/portable/pwarnings.h +52 -0
  140. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/flatcc.c +3052 -0
  141. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/nanoarrow.c +3019 -0
  142. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/nanoarrow.h +3354 -0
  143. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/nanoarrow.hpp +344 -0
  144. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c +29305 -0
  145. snowflake/connector/_internal/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.h +381 -0
  146. snowflake/connector/_internal/nanoarrow_cpp/Logging/logging.cpp +108 -0
  147. snowflake/connector/_internal/nanoarrow_cpp/Logging/logging.hpp +47 -0
  148. snowflake/connector/_internal/nanoarrow_cpp/scripts/.clang-format +8 -0
  149. snowflake/connector/_internal/nanoarrow_cpp/scripts/format.sh +8 -0
  150. snowflake/connector/_internal/protobuf_gen/__init__.py +0 -0
  151. snowflake/connector/_internal/protobuf_gen/database_driver_v1_pb2.py +408 -0
  152. snowflake/connector/_internal/protobuf_gen/database_driver_v1_pb2.pyi +4487 -0
  153. snowflake/connector/_internal/protobuf_gen/database_driver_v1_services.py +2088 -0
  154. snowflake/connector/_internal/protobuf_gen/proto_exception.py +17 -0
  155. snowflake/connector/_internal/result_batch.py +150 -0
  156. snowflake/connector/_internal/snowflake_restful.py +222 -0
  157. snowflake/connector/_internal/snowpark_backcompat_helpers.py +31 -0
  158. snowflake/connector/_internal/sqlstate.py +11 -0
  159. snowflake/connector/_internal/statement_utils.py +207 -0
  160. snowflake/connector/_internal/text_utils.py +112 -0
  161. snowflake/connector/_internal/type_codes.py +139 -0
  162. snowflake/connector/_internal/utils.py +65 -0
  163. snowflake/connector/_internal/write_pandas_operation.py +657 -0
  164. snowflake/connector/aio/README.md +168 -0
  165. snowflake/connector/aio/__init__.py +37 -0
  166. snowflake/connector/aio/connection/__init__.py +17 -0
  167. snowflake/connector/aio/connection/_connection.py +506 -0
  168. snowflake/connector/aio/cursor/__init__.py +35 -0
  169. snowflake/connector/aio/cursor/_base.py +1034 -0
  170. snowflake/connector/aio/cursor/_dict_cursor.py +78 -0
  171. snowflake/connector/aio/cursor/_result_set_wrapper.py +35 -0
  172. snowflake/connector/aio/cursor/_snowflake_cursor.py +72 -0
  173. snowflake/connector/aio/pandas_tools.py +279 -0
  174. snowflake/connector/aio/result_batch.py +165 -0
  175. snowflake/connector/auth/__init__.py +0 -0
  176. snowflake/connector/auth/workload_identity.py +5 -0
  177. snowflake/connector/compat.py +22 -0
  178. snowflake/connector/config_manager.py +392 -0
  179. snowflake/connector/connection/__init__.py +30 -0
  180. snowflake/connector/connection/_connection.py +641 -0
  181. snowflake/connector/connection_config.py +517 -0
  182. snowflake/connector/constants.py +52 -0
  183. snowflake/connector/cursor/__init__.py +37 -0
  184. snowflake/connector/cursor/_base.py +1169 -0
  185. snowflake/connector/cursor/_chunked_download_reader.py +75 -0
  186. snowflake/connector/cursor/_dict_cursor.py +78 -0
  187. snowflake/connector/cursor/_result_set_wrapper.py +35 -0
  188. snowflake/connector/cursor/_snowflake_cursor.py +72 -0
  189. snowflake/connector/description.py +7 -0
  190. snowflake/connector/errors.py +492 -0
  191. snowflake/connector/network.py +71 -0
  192. snowflake/connector/pandas_tools.py +191 -0
  193. snowflake/connector/py.typed +0 -0
  194. snowflake/connector/result_batch.py +216 -0
  195. snowflake/connector/telemetry.py +40 -0
  196. snowflake/connector/time_util.py +11 -0
  197. snowflake/connector/types.py +134 -0
  198. snowflake/connector/util_text.py +3 -0
  199. snowflake/connector/version.py +23 -0
  200. snowflake_connector_python-5.2.0.dist-info/DELVEWHEEL +2 -0
  201. snowflake_connector_python-5.2.0.dist-info/METADATA +190 -0
  202. snowflake_connector_python-5.2.0.dist-info/RECORD +204 -0
  203. snowflake_connector_python-5.2.0.dist-info/WHEEL +4 -0
  204. snowflake_connector_python.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
@@ -0,0 +1,517 @@
1
+ """Auto-generated from PARAM_DEFS in sf_params_spec. DO NOT EDIT.
2
+
3
+ Regenerated by the generate-connection-config pre-commit hook whenever the
4
+ sf_params_spec registry or the generator changes. Any manual changes will be
5
+ silently overwritten.
6
+
7
+ This file intentionally contains only information derivable from
8
+ ``PARAM_DEFS``: the dataclass fields and the ``_ALIAS_MAP`` /
9
+ ``_PYTHON_TO_RUST_NAME`` / ``_SENSITIVE_PARAMS`` lookup tables. Behavioural
10
+ helpers (``from_kwargs``, ``to_options``, ``to_proto_options``, legacy
11
+ rewrites, application validation, Python-only fields) live in
12
+ :mod:`snowflake.connector._internal.connection_config_mixin` and are inherited
13
+ via :class:`ConnectionConfigMixin`.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ from dataclasses import dataclass
19
+ from typing import Any, ClassVar
20
+
21
+ from snowflake.connector._internal.connection_config_mixin import (
22
+ ConnectionConfigMixin,
23
+ OptionsModifier,
24
+ )
25
+
26
+
27
+ __all__ = ["ConnectionConfig", "OptionsModifier"]
28
+
29
+
30
+ @dataclass
31
+ class ConnectionConfig(ConnectionConfigMixin):
32
+ """Typed connection configuration derived from sf_params_spec PARAM_DEFS.
33
+
34
+ Fields use defaults from the Rust core where defined, ``None`` otherwise.
35
+ Behavioural helpers (``from_kwargs``, ``to_options``, etc.) are inherited
36
+ from :class:`ConnectionConfigMixin`.
37
+ """
38
+
39
+ # -- Connection parameters --------------------------------------------------
40
+ account: str | None = None
41
+ """Snowflake account identifier. Required"""
42
+
43
+ allow_empty_proxy: bool | None = True
44
+ """Empty PROXY value explicitly disables proxy (overrides env). Default: True"""
45
+
46
+ application: str | None = None
47
+ """User-facing application name sent as CLIENT_ENVIRONMENT.APPLICATION (falls back to client_app_id)"""
48
+
49
+ authentication_timeout: int | None = 120
50
+ """Timeout in seconds for native Okta SSO authentication. Default: 120"""
51
+
52
+ authenticator: str | None = None
53
+ """Authenticator type for the connection"""
54
+
55
+ client_app_id: str | None = None
56
+ """Driver identity sent as CLIENT_APP_ID in the login request (e.g. PythonConnector, SnowSQL)"""
57
+
58
+ client_app_version: str | None = None
59
+ """Driver version sent as CLIENT_APP_VERSION in the login request"""
60
+
61
+ client_store_temporary_credential: bool | None = True
62
+ """When true, persist ID, OAuth, and MFA tokens in the OS credential store. Defaults to true. An explicit value
63
+ always wins.
64
+
65
+ Default: True
66
+ """
67
+
68
+ connect_timeout: int | None = None
69
+ """HTTP connect timeout in seconds for name lookup, TCP, and TLS (0 = no timeout, absent = 60)"""
70
+
71
+ connection_diag_allowlist_path: str | None = None
72
+ """Path to a pre-fetched allowlist.json; if absent the driver fetches it via system$allowlist()"""
73
+
74
+ connection_diag_log_path: str | None = None
75
+ """Directory where the diagnostic report file is written (defaults to system tmpdir)"""
76
+
77
+ connection_name: str | None = None
78
+ """Named connection to load from TOML configuration files"""
79
+
80
+ crl_allow_certificates_without_crl_url: bool | None = False
81
+ """Allow certificates that do not include a CRL distribution URL. Default: False"""
82
+
83
+ crl_cache_cleanup_interval: int | None = 3600
84
+ """Interval in seconds between background CRL cache cleanup passes. Default: 3600"""
85
+
86
+ crl_cache_dir: str | None = None
87
+ """Directory for CRL cache files"""
88
+
89
+ crl_cache_start_cleanup: bool | None = False
90
+ """Run the background CRL cache cleanup task. Default: False"""
91
+
92
+ crl_check_mode: str | None = "DISABLED"
93
+ """Certificate revocation check mode (DISABLED, ENABLED, ADVISORY). Default: 'DISABLED'"""
94
+
95
+ crl_connection_timeout: int | None = 10
96
+ """Connection timeout in seconds for CRL endpoints. Default: 10"""
97
+
98
+ crl_enable_disk_caching: bool | None = True
99
+ """Enable disk caching for CRL responses. Default: True"""
100
+
101
+ crl_enable_memory_caching: bool | None = True
102
+ """Enable in-memory caching for CRL responses. Default: True"""
103
+
104
+ crl_http_timeout: int | None = 10
105
+ """HTTP timeout in seconds for CRL endpoint requests. Default: 10"""
106
+
107
+ crl_max_download_size: int | None = 20971520
108
+ """Maximum CRL download size in bytes before the download is aborted. Default: 20971520"""
109
+
110
+ crl_on_disk_cache_removal_delay: int | None = 604800
111
+ """Delay in seconds after a CRL's nextUpdate before it is purged from the on-disk cache. Default: 604800"""
112
+
113
+ crl_unsafe_skip_file_permissions_check: bool | None = False
114
+ """Skip verification that on-disk CRL cache files and directory are owner-only (0600/0700). Default: False"""
115
+
116
+ crl_validity_time: int | None = 86400
117
+ """Maximum age in seconds of a cached CRL before it is re-fetched. Default: 86400"""
118
+
119
+ custom_root_store_path: str | None = None
120
+ """Path to custom root certificate store"""
121
+
122
+ disable_parallel_user_prompt: bool | None = True
123
+ """When true (default), enables process-global serialization of interactive auth prompts (external browser, MFA,
124
+ OAuth) so that only one prompt is shown per <user, host> when clientStoreTemporaryCredential is enabled. Set to
125
+ false to allow each concurrent connection to show its own prompt..
126
+
127
+ Default: True
128
+ """
129
+
130
+ disable_query_context_cache: bool | None = False
131
+ """When true, disables the client-side query context cache. No context is sent in requests and server-returned
132
+ context is ignored..
133
+
134
+ Default: False
135
+ """
136
+
137
+ disable_saml_url_check: bool | None = False
138
+ """Skip the Okta SAML URL host-match safety check. Default: False"""
139
+
140
+ enable_connection_diag: bool | None = None
141
+ """Run connectivity diagnostics during connect and write a report"""
142
+
143
+ enable_server_session_keep_alive_auto_detection: bool | None = None
144
+ """Enable auto-detection of async queries before logout (SNOW-2314152)"""
145
+
146
+ external_session_id: str | None = None
147
+ """External session identifier used with authenticator=PAT_WITH_EXTERNAL_SESSION. Sent as
148
+ X-Snowflake-External-Session-ID on every request; the server keys the session by (PAT, external_session_id).
149
+
150
+ Required when authenticator=PAT_WITH_EXTERNAL_SESSION
151
+ """
152
+
153
+ host: str | None = None
154
+ """Snowflake server hostname"""
155
+
156
+ include_retry_reason: bool | None = True
157
+ """When true, appends retryReason (the HTTP status code that triggered the retry, or 0 for transport errors with no
158
+ HTTP response) alongside retryCount on retried query requests..
159
+
160
+ Default: True
161
+ """
162
+
163
+ jwt_timeout: int | None = 120
164
+ """Lifetime in seconds for each key-pair authentication JWT (0 uses the default; must not be negative).
165
+
166
+ Default: 120
167
+ """
168
+
169
+ log_max_query_length: int | None = 80
170
+ """Maximum number of characters of a query string to include in log messages. Default: 80"""
171
+
172
+ log_query_parameters: bool | str | None = False
173
+ """Include the (truncated) JSON bindings in INFO query logs (requires log_query_text). Default: False"""
174
+
175
+ log_query_text: bool | str | None = False
176
+ """Include the (truncated) SQL text in INFO query logs. Default: False"""
177
+
178
+ login_timeout: int | None = 120
179
+ """Wall-clock timeout in seconds for the entire login operation including retries (0 = no timeout). Default: 120"""
180
+
181
+ logout_error_strategy: str | None = None
182
+ """Error handling strategy for logout: 'best_effort' or 'strict'"""
183
+
184
+ logout_max_attempts: int | None = None
185
+ """Maximum total attempts for logout (1 = no retry, 3 = 2 retries)"""
186
+
187
+ logout_request_timeout_seconds: int | None = None
188
+ """Per-request socket timeout for individual logout attempts"""
189
+
190
+ logout_total_timeout_seconds: int | None = None
191
+ """Total timeout budget for logout operation including retries"""
192
+
193
+ master_token: str | None = None
194
+ """Pre-acquired master token for session token authentication"""
195
+
196
+ master_validity_in_seconds: int | None = None
197
+ """Remaining validity in seconds for the master token (session token auth)"""
198
+
199
+ max_tls_version: str | None = "tls13"
200
+ """Maximum TLS protocol version to negotiate (tls12 or tls13). Default: 'tls13'"""
201
+
202
+ min_tls_version: str | None = "tls12"
203
+ """Minimum TLS protocol version to negotiate (tls12 or tls13). Default: 'tls12'"""
204
+
205
+ no_proxy: str | None = None
206
+ """Comma-separated list of hosts to bypass the proxy for"""
207
+
208
+ oauth_authorization_url: str | None = None
209
+ """IdP authorization endpoint (defaults to https://{host}/oauth/authorize)"""
210
+
211
+ oauth_client_id: str | None = None
212
+ """OAuth client identifier (LOCAL_APPLICATION when Snowflake is the IdP)"""
213
+
214
+ oauth_client_secret: str | None = None
215
+ """OAuth client secret (redacted from logs)"""
216
+
217
+ oauth_credentials_in_body: bool | None = False
218
+ """Send client_id/client_secret in the OAUTH_CLIENT_CREDENTIALS token request body (client_secret_post) instead of
219
+ the HTTP Basic header.
220
+
221
+ Default: False
222
+ """
223
+
224
+ oauth_disable_pkce: bool | None = False
225
+ """Disable PKCE S256 challenge for OAUTH_AUTHORIZATION_CODE (Python-compatible escape hatch). Default: False"""
226
+
227
+ oauth_enable_dpop: bool | None = False
228
+ """Enable RFC 9449 DPoP proof-of-possession (JDBC-compatible). Default: False"""
229
+
230
+ oauth_enable_single_use_refresh_tokens: bool | None = False
231
+ """Request single-use refresh-token rotation (Snowflake-IdP only). Default: False"""
232
+
233
+ oauth_redirect_uri: str | None = None
234
+ """Loopback redirect URI advertised to the IdP (defaults to http://127.0.0.1:<random>)"""
235
+
236
+ oauth_scope: str | None = None
237
+ """OAuth scope (space-separated; defaults to session:role:<role>)"""
238
+
239
+ oauth_token_request_url: str | None = None
240
+ """IdP token endpoint (CC only; defaults to https://{host}/oauth/token-request for AC).
241
+
242
+ Required when authenticator=OAUTH_CLIENT_CREDENTIALS
243
+ """
244
+
245
+ okta_username: str | None = None
246
+ """Okta username (defaults to the Snowflake user if omitted)"""
247
+
248
+ passcode: str | None = None
249
+ """MFA passcode for USERNAME_PASSWORD_MFA authentication"""
250
+
251
+ passcode_in_password: bool | None = False
252
+ """Whether the MFA passcode is appended to the password. Default: False"""
253
+
254
+ password: str | None = None
255
+ """Login password. Required when authenticator=SNOWFLAKE_PASSWORD"""
256
+
257
+ platform_detection_timeout_seconds: float | None = None
258
+ """Python-only. Accepted for compatibility and ignored; each cloud-metadata platform check is limited to 2 seconds.
259
+ """
260
+
261
+ port: int | None = None
262
+ """Server port number"""
263
+
264
+ preserve_underscores_in_hostname: bool | None = False
265
+ """Preserve underscores in the hostname derived from the account name. Default: False"""
266
+
267
+ private_key: Any | None = None
268
+ """Private key for key-pair authentication (PEM or base64 text, DER bytes, or an RSAPrivateKey or
269
+ EllipticCurvePrivateKey).
270
+
271
+ Required when authenticator=SNOWFLAKE_JWT
272
+ """
273
+
274
+ private_key_file: str | None = None
275
+ """Path to private key file for key-pair authentication"""
276
+
277
+ private_key_password: str | None = None
278
+ """Passphrase for encrypted private key"""
279
+
280
+ protocol: str | None = None
281
+ """Connection protocol (http or https)"""
282
+
283
+ proxy: str | None = None
284
+ """Proxy URL ([scheme://][user:pass@]host[:port]); legacy ODBC `PROXY` form"""
285
+
286
+ proxy_host: str | None = None
287
+ """Proxy server hostname"""
288
+
289
+ proxy_password: str | None = None
290
+ """Proxy server password for Basic auth"""
291
+
292
+ proxy_port: int | None = None
293
+ """Proxy server port"""
294
+
295
+ proxy_scheme: str | None = None
296
+ """Scheme for the hop to the proxy: http (default) or https"""
297
+
298
+ proxy_user: str | None = None
299
+ """Proxy server username for Basic auth"""
300
+
301
+ put_get_max_attempts: int | None = 6
302
+ """Maximum total attempts for a single PUT/GET file transfer (1 = no retry). Default: 6"""
303
+
304
+ query_timeout: int | None = 0
305
+ """Wall-clock timeout in seconds for query execution including retries (0 = no timeout). Default: 0"""
306
+
307
+ request_timeout: int | None = 120
308
+ """Wall-clock timeout in seconds for all other operations (close session, heartbeat, etc.) including retries (0 = no
309
+ timeout).
310
+
311
+ Default: 120
312
+ """
313
+
314
+ retry_backoff_base_ms: int | None = 250
315
+ """Initial exponential-backoff delay in milliseconds between retry attempts. Default: 250"""
316
+
317
+ retry_backoff_cap_ms: int | None = 16000
318
+ """Maximum exponential-backoff delay in milliseconds between retry attempts. Default: 16000"""
319
+
320
+ retry_backoff_factor: float | None = 2
321
+ """Multiplier applied to the backoff delay after each retry attempt. Default: 2"""
322
+
323
+ retry_backoff_jitter: str | None = "decorrelated"
324
+ """Backoff jitter strategy: 'none', 'full', or 'decorrelated'. Default: 'decorrelated'"""
325
+
326
+ retry_extra_status_codes: str | None = None
327
+ """Additional HTTP status codes (comma-separated) to retry on general HTTP and PUT/GET calls, beyond the built-in
328
+ 408/429/307/308/5xx set
329
+ """
330
+
331
+ retry_max_attempts: int | None = 6
332
+ """Maximum total attempts for general HTTP calls (login, query, logout). 1 = no retry. Default: 6"""
333
+
334
+ retry_timeout: int | None = None
335
+ """Per-request timeout in seconds for a single HTTP attempt within a retry loop (0 = no timeout, absent = 300)"""
336
+
337
+ secondary_roles: str | None = None
338
+ """Secondary-roles activation mode sent at login (e.g. ALL or NONE)"""
339
+
340
+ serialize_session_operations: bool | None = None
341
+ """When true, core holds a per-connection gate across every backend session operation so only one is in flight at a
342
+ time. When unset, defaults to the wrapper's preset, client-only. Set at connect, cannot be changed after.
343
+ """
344
+
345
+ server_session_keep_alive: bool | None = None
346
+ """Control server session lifecycle: true=keep alive, false=always logout, null=auto-detect"""
347
+
348
+ server_url: str | None = None
349
+ """Full server URL (alternative to host/port/protocol)"""
350
+
351
+ session_token: str | None = None
352
+ """Pre-acquired session token for session token authentication"""
353
+
354
+ ssl: bool | None = None
355
+ """Enable or disable SSL/TLS (sets protocol to https or http). Deprecated: use protocol instead"""
356
+
357
+ tls_skip_verify: bool | None = False
358
+ """Skip all TLS verification with a single switch: disables both certificate and hostname checks (and, since
359
+ certificate verification is off, CRL revocation checks are bypassed too). Insecure; intended for testing only.
360
+
361
+ Default: False
362
+ """
363
+
364
+ token: str | None = None
365
+ """Pre-acquired bearer token (PAT, legacy OAUTH, or OIDC WIF). Alternative to token_file_path.
366
+
367
+ Required when authenticator=PROGRAMMATIC_ACCESS_TOKEN
368
+ """
369
+
370
+ token_file_path: str | None = None
371
+ """Path to a file containing a pre-acquired bearer token (PAT, legacy OAUTH, or OIDC WIF). If both token and
372
+ token_file_path are set, the file contents are used
373
+ """
374
+
375
+ unsafe_file_write: bool | None = False
376
+ """When true, GET downloads use the process umask permissions instead of owner-only (0600). Unix-only; ignored on
377
+ Windows.
378
+
379
+ Default: False
380
+ """
381
+
382
+ unsafe_skip_config_file_permissions_check: bool | None = False
383
+ """When true, skip file permission checks on config.toml and connections.toml during connection setup. Use in
384
+ environments where permissions cannot be controlled (CI runners, containers). Unix-only; ignored on Windows.
385
+
386
+ Default: False
387
+ """
388
+
389
+ use_current_catalog: bool | None = False
390
+ """When true, a NULL CatalogName on catalog functions is the current database. When false (default), the catalog is
391
+ unconstrained unless CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX fills it.
392
+
393
+ Default: False
394
+ """
395
+
396
+ use_proxy_env: bool | None = None
397
+ """Honour HTTP_PROXY/HTTPS_PROXY/NO_PROXY env vars when no explicit proxy is set. Unset uses the wrapper preset
398
+ (true for Python and Node.js, false otherwise)
399
+ """
400
+
401
+ user: str | None = None
402
+ """Login username. Required"""
403
+
404
+ validate_default_parameters: bool | None = None
405
+ """Validate that the default database, schema, and warehouse exist on the server at connect time"""
406
+
407
+ verify_certificates: bool | None = True
408
+ """Whether to verify TLS certificates. Default: True"""
409
+
410
+ verify_hostname: bool | None = True
411
+ """Whether to verify the server hostname in TLS. Default: True"""
412
+
413
+ wif_host: str | None = None
414
+ """AWS STS hostname for Workload Identity Federation. Unset keeps the regional default"""
415
+
416
+ workload_identity_aws_use_outbound_token: bool | None = False
417
+ """Use outbound STS GetWebIdentityToken for AWS WIF (default: pre-signed GetCallerIdentity). Default: False"""
418
+
419
+ workload_identity_entra_resource: str | None = None
420
+ """Azure Entra resource URI for managed-identity token (Azure only; defaults to
421
+ api://fd3f753b-eed3-462c-b6a7-a4b5bb650aad)
422
+ """
423
+
424
+ workload_identity_impersonation_path: str | None = None
425
+ """Comma-separated impersonation chain for WIF (AWS role ARNs or GCP service account emails)"""
426
+
427
+ workload_identity_provider: str | None = None
428
+ """Cloud provider for WIF attestation (AWS, AZURE, GCP, OIDC). Required when authenticator=WORKLOAD_IDENTITY"""
429
+
430
+ # -- Session parameters --------------------------------------------------
431
+ client_memory_limit: int | None = 1536
432
+ """Memory budget in MB for chunk prefetch buffer (0 = unlimited). Default: 1536"""
433
+
434
+ client_prefetch_threads: int | None = None
435
+ """Number of concurrent chunk prefetch threads for result set downloading"""
436
+
437
+ client_session_keep_alive: bool | None = None
438
+ """Keep the session alive with periodic heartbeat requests"""
439
+
440
+ client_session_keep_alive_heartbeat_frequency: int | None = None
441
+ """Heartbeat frequency in seconds (clamped to interval master_token_validity/16..master_token_validity/4)"""
442
+
443
+ autocommit: bool | None = None
444
+ """Session autocommit mode"""
445
+
446
+ client_metadata_request_use_connection_ctx: bool | None = None
447
+ """Use the connection context for metadata requests"""
448
+
449
+ client_out_of_band_telemetry_enabled: bool | None = None
450
+ """Enable out-of-band client telemetry"""
451
+
452
+ client_timestamp_type_mapping: str | None = None
453
+ """Timestamp type used for generic timestamp values"""
454
+
455
+ database: str | None = None
456
+ """Default database to use"""
457
+
458
+ gcs_use_downscoped_credential: bool | None = None
459
+ """Use downscoped credentials for GCS"""
460
+
461
+ query_tag: str | None = None
462
+ """String label attached to queries and surfaced in QUERY_HISTORY. Settable at the session level (connection option
463
+ or session override, forwarded as a login session parameter) and overridable per-statement.
464
+ """
465
+
466
+ role: str | None = None
467
+ """Default role to use"""
468
+
469
+ schema: str | None = None
470
+ """Default schema to use"""
471
+
472
+ service_name: str | None = None
473
+ """Snowflake service name"""
474
+
475
+ timezone: str | None = None
476
+ """Session timezone, overridable per statement"""
477
+
478
+ use_s3_regional_url: bool | None = False
479
+ """Force the S3 regional endpoint for PUT/GET (PrivateLink-to-S3). Default: False"""
480
+
481
+ warehouse: str | None = None
482
+ """Default warehouse to use"""
483
+
484
+ _ALIAS_MAP: ClassVar[dict[str, str]] = {
485
+ "enable_retry_reason_in_query_response": "include_retry_reason",
486
+ "enable_stage_s3_privatelink_for_us_east_1": "use_s3_regional_url",
487
+ "passcodeinpassword": "passcode_in_password",
488
+ "private_key_file_pwd": "private_key_password",
489
+ "workload_identity_host": "wif_host",
490
+ }
491
+ """Lowercased alias -> Python field name."""
492
+
493
+ _PYTHON_TO_RUST_NAME: ClassVar[dict[str, str]] = {
494
+ "client_memory_limit": "CLIENT_MEMORY_LIMIT",
495
+ "client_prefetch_threads": "CLIENT_PREFETCH_THREADS",
496
+ "client_session_keep_alive": "CLIENT_SESSION_KEEP_ALIVE",
497
+ "client_session_keep_alive_heartbeat_frequency": "CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY",
498
+ "passcode_in_password": "passcodeInPassword",
499
+ }
500
+ """Python field name -> Rust canonical name (only for names that differ)."""
501
+
502
+ _SENSITIVE_PARAMS: ClassVar[frozenset[str]] = frozenset(
503
+ {
504
+ "external_session_id",
505
+ "master_token",
506
+ "oauth_client_secret",
507
+ "passcode",
508
+ "password",
509
+ "private_key",
510
+ "private_key_password",
511
+ "proxy",
512
+ "proxy_password",
513
+ "session_token",
514
+ "token",
515
+ }
516
+ )
517
+ """Fields that contain secrets (for log redaction)."""
@@ -0,0 +1,52 @@
1
+ """Constants module for snowflake-connector-python."""
2
+
3
+ from enum import Enum, unique
4
+
5
+ from ._internal.authenticator_type import AuthenticatorType # noqa: F401 - backward compatibility re-exports
6
+ from ._internal.type_codes import FIELD_ID_TO_NAME # noqa: F401 - backward compatibility re-exports
7
+ from .config_manager import CONFIG_FILE, CONNECTIONS_FILE # noqa: F401 - backward compatibility re-exports
8
+
9
+
10
+ @unique
11
+ class QueryStatus(Enum):
12
+ RUNNING = 0
13
+ ABORTING = 1
14
+ SUCCESS = 2
15
+ FAILED_WITH_ERROR = 3
16
+ ABORTED = 4
17
+ QUEUED = 5
18
+ FAILED_WITH_INCIDENT = 6
19
+ DISCONNECTED = 7
20
+ RESUMING_WAREHOUSE = 8
21
+ QUEUED_REPARING_WAREHOUSE = 9 # intentional typo, matches server-side QueryDTO.java
22
+ RESTARTED = 10
23
+ BLOCKED = 11
24
+ NO_DATA = 12
25
+
26
+
27
+ # backward compatibility constant
28
+ UTF8 = "utf-8"
29
+
30
+ # Partner programs set this so CLIENT_ENVIRONMENT.APPLICATION is populated
31
+ # without passing ``application=`` to connect(). Mirrors snowflake-connector-python.
32
+ ENV_VAR_PARTNER = "SF_PARTNER"
33
+
34
+
35
+ class StatementParameterName:
36
+ """Known statement-level parameter names.
37
+
38
+ These correspond to the statement-scoped entries in sf_core's
39
+ ``param_registry``. Pass them via the ``parameters`` dict when
40
+ executing a statement.
41
+ """
42
+
43
+ MULTI_STATEMENT_COUNT = "MULTI_STATEMENT_COUNT"
44
+ ASYNC_EXECUTION = "ASYNC_EXECUTION"
45
+ SKIP_UPLOAD_ON_CONTENT_MATCH = "skip_upload_on_content_match"
46
+
47
+
48
+ class SessionParameterName:
49
+ """Known Snowflake session parameter names referenced by the connector."""
50
+
51
+ CLIENT_STAGE_ARRAY_BINDING_THRESHOLD = "CLIENT_STAGE_ARRAY_BINDING_THRESHOLD"
52
+ CLIENT_TELEMETRY_ENABLED = "CLIENT_TELEMETRY_ENABLED"
@@ -0,0 +1,37 @@
1
+ """
2
+ PEP 249 Database API 2.0 Cursor Objects
3
+
4
+ This package defines the cursor classes as specified in PEP 249.
5
+
6
+ Hierarchy:
7
+ SnowflakeCursorBase
8
+ ├── SnowflakeCursor — returns tuple rows
9
+ └── DictCursor — returns dict rows
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from .._internal.cursor import DictRow, QueryResultStats, ResultMetadata, ResultMetadataV2, Row
15
+ from .._internal.cursor.query_result_waiter import _RETRY_PATTERN as ASYNC_RETRY_PATTERN
16
+ from ._base import SnowflakeCursorBase
17
+ from ._dict_cursor import DictCursor
18
+ from ._snowflake_cursor import SnowflakeCursor
19
+
20
+
21
+ CursorType = type[SnowflakeCursor] | type[DictCursor]
22
+ CursorInstance = SnowflakeCursor | DictCursor
23
+
24
+
25
+ __all__ = [
26
+ "ASYNC_RETRY_PATTERN", # snowpark_compat
27
+ "CursorInstance",
28
+ "CursorType",
29
+ "DictCursor",
30
+ "DictRow",
31
+ "QueryResultStats",
32
+ "ResultMetadata",
33
+ "ResultMetadataV2",
34
+ "Row",
35
+ "SnowflakeCursor",
36
+ "SnowflakeCursorBase",
37
+ ]