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,75 @@
1
+ from __future__ import annotations
2
+
3
+ import io
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ from .._internal.api_client.client_api import CHUNK_SIZE, core_driver
8
+
9
+
10
+ if TYPE_CHECKING:
11
+ from _typeshed import WriteableBuffer
12
+
13
+ from .._internal.protobuf_gen.database_driver_v1_pb2 import DownloadStreamHandle
14
+
15
+
16
+ class _ChunkedDownloadReader(io.RawIOBase):
17
+ """Lazily reads a stage file via the Begin/Chunk/Close RPCs.
18
+
19
+ Nothing beyond Begin fires until read; each ``read()`` pulls one chunk
20
+ via :func:`readinto`, so at most one chunk sits in memory. This holds for
21
+ iteration and for ``read(size)`` with a non-negative *size* — ``read(-1)``
22
+ / ``readall()`` (the ``io.RawIOBase`` default for a full read) loops
23
+ ``readinto`` to EOF and accumulates the whole file in memory, inherent to
24
+ a read-all. The session is released exactly once, on EOF, on error, or on
25
+ close (including via ``io.IOBase.__del__`` as a safety net) — whichever
26
+ happens first.
27
+ """
28
+
29
+ def __init__(self, download_handle: DownloadStreamHandle) -> None:
30
+ super().__init__()
31
+ self._download_handle = download_handle
32
+ self._pending = b""
33
+ self._eof = False
34
+ self._handle_released = False
35
+
36
+ def readable(self) -> bool:
37
+ return True
38
+
39
+ def readinto(self, b: WriteableBuffer) -> int:
40
+ # Loop rather than pull-once: a chunk with data=b"" and eof=False is a
41
+ # legal (if unusual) core response, and returning 0 here would make
42
+ # io.RawIOBase.readall() treat it as EOF and silently truncate.
43
+ while not self._pending and not self._eof:
44
+ self._pull_chunk()
45
+ view = memoryview(b)
46
+ n = min(len(view), len(self._pending))
47
+ view[:n] = self._pending[:n]
48
+ self._pending = self._pending[n:]
49
+ return n
50
+
51
+ def _pull_chunk(self) -> None:
52
+ """Fetch one core-side chunk into ``_pending``; release on EOF/error."""
53
+ try:
54
+ response = core_driver.download_stream_chunk(self._download_handle, CHUNK_SIZE)
55
+ except BaseException:
56
+ self._release_handle()
57
+ raise
58
+ self._pending = response.data
59
+ if response.eof:
60
+ self._eof = True
61
+ self._release_handle()
62
+
63
+ def _release_handle(self) -> None:
64
+ if self._handle_released:
65
+ return
66
+ self._handle_released = True
67
+ core_driver.download_stream_close(self._download_handle)
68
+
69
+ def close(self) -> None:
70
+ if self.closed:
71
+ return
72
+ try:
73
+ self._release_handle()
74
+ finally:
75
+ super().close()
@@ -0,0 +1,78 @@
1
+ """Concrete DictCursor — returns dict rows."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import cast
6
+
7
+ from .._internal.cursor import DictRow
8
+ from .._internal.errorhandler import simplified_error_handling
9
+ from ._base import SnowflakeCursorBase
10
+
11
+
12
+ class DictCursor(SnowflakeCursorBase):
13
+ """Cursor returning results as dictionaries with column names as keys.
14
+
15
+ Usage::
16
+
17
+ with connection.cursor(DictCursor) as cur:
18
+ cur.execute("SELECT 1 AS id, 'hello' AS name")
19
+ row = cur.fetchone()
20
+ # row == {"ID": 1, "NAME": "hello"}
21
+ """
22
+
23
+ @property
24
+ def _use_dict_result(self) -> bool:
25
+ return True
26
+
27
+ @simplified_error_handling
28
+ def fetchone(self) -> DictRow | None:
29
+ """
30
+ Fetch the next row of a query result set as a dictionary.
31
+
32
+ Returns:
33
+ dict: Next row as a dictionary with column names as keys,
34
+ or None when no more data is available
35
+ """
36
+ return cast(DictRow | None, self._fetchone())
37
+
38
+ @simplified_error_handling
39
+ def fetchmany(self, size: int | None = None) -> list[DictRow]:
40
+ """
41
+ Fetch the next set of rows as dictionaries.
42
+
43
+ Args:
44
+ size (int): Number of rows to fetch (defaults to arraysize)
45
+
46
+ Returns:
47
+ list[dict]: List of rows as dictionaries
48
+ """
49
+ return super().fetchmany(size)
50
+
51
+ def fetchall(self) -> list[DictRow]:
52
+ """
53
+ Fetch all (remaining) rows as dictionaries.
54
+
55
+ Returns:
56
+ list[dict]: List of all remaining rows as dictionaries
57
+ """
58
+ return super().fetchall()
59
+
60
+ def __next__(self) -> DictRow:
61
+ """
62
+ Fetch the next row from the currently executed statement as a dictionary.
63
+
64
+ Returns:
65
+ dict: Next row
66
+
67
+ Raises:
68
+ StopIteration: When no more rows are available
69
+ """
70
+ return cast(DictRow, super().__next__())
71
+
72
+ def next(self) -> DictRow:
73
+ """Python 2 compatibility alias for ``__next__``. Returns a dictionary row.
74
+
75
+ Raises:
76
+ StopIteration: When no more rows are available
77
+ """
78
+ return self.__next__()
@@ -0,0 +1,35 @@
1
+ from __future__ import annotations
2
+
3
+ from .._internal.api_client.client_api import core_driver
4
+ from .._internal.cursor.result_set_wrapper import ResultSetWrapperBase
5
+ from .._internal.protobuf_gen.database_driver_v1_pb2 import (
6
+ ResultSetGetChunksResponse,
7
+ )
8
+ from .._internal.statement_utils import get_stream_ptr
9
+
10
+
11
+ class _ResultSetWrapper(ResultSetWrapperBase):
12
+ """Sync result-set handle owner."""
13
+
14
+ def get_arrow_stream_ptr(self) -> int:
15
+ """Fetch the Arrow stream and return the raw C pointer.
16
+
17
+ Each call builds a fresh stream from the stored result set data.
18
+
19
+ Raises:
20
+ ProgrammingError: If no handle is held.
21
+ """
22
+ handle = self._require_handle()
23
+ response = core_driver.result_set_get_stream(result_set_handle=handle)
24
+ return get_stream_ptr(response)
25
+
26
+ def get_chunks(self) -> ResultSetGetChunksResponse | None:
27
+ """Call ``result_set_get_chunks`` on the held handle, or return ``None``.
28
+
29
+ Safe to call multiple times and independently of :meth:`get_arrow_stream_ptr` —
30
+ the core layer re-fetches chunk metadata from Snowflake if the cached copy
31
+ was already consumed.
32
+ """
33
+ if self._handle is None:
34
+ return None
35
+ return core_driver.result_set_get_chunks(result_set_handle=self._handle)
@@ -0,0 +1,72 @@
1
+ """Concrete SnowflakeCursor — returns tuple rows."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import cast
6
+
7
+ from .._internal.cursor import Row
8
+ from .._internal.errorhandler import simplified_error_handling
9
+ from ._base import SnowflakeCursorBase
10
+
11
+
12
+ class SnowflakeCursor(SnowflakeCursorBase):
13
+ """Cursor returning results as tuples (default).
14
+
15
+ This is the standard cursor returned by ``connection.cursor()``.
16
+ """
17
+
18
+ @property
19
+ def _use_dict_result(self) -> bool:
20
+ return False
21
+
22
+ @simplified_error_handling
23
+ def fetchone(self) -> Row | None:
24
+ """
25
+ Fetch the next row of a query result set.
26
+
27
+ Returns:
28
+ tuple: Next row, or None when no more data is available
29
+ """
30
+ return cast(Row | None, self._fetchone())
31
+
32
+ @simplified_error_handling
33
+ def fetchmany(self, size: int | None = None) -> list[Row]:
34
+ """
35
+ Fetch the next set of rows of a query result.
36
+
37
+ Args:
38
+ size (int): Number of rows to fetch (defaults to arraysize)
39
+
40
+ Returns:
41
+ list[tuple]: List of rows as tuples
42
+ """
43
+ return super().fetchmany(size)
44
+
45
+ def fetchall(self) -> list[Row]:
46
+ """
47
+ Fetch all (remaining) rows of a query result.
48
+
49
+ Returns:
50
+ list[tuple]: List of all remaining rows as tuples
51
+ """
52
+ return super().fetchall()
53
+
54
+ def __next__(self) -> Row:
55
+ """
56
+ Fetch the next row from the currently executed statement.
57
+
58
+ Returns:
59
+ tuple: Next row
60
+
61
+ Raises:
62
+ StopIteration: When no more rows are available
63
+ """
64
+ return cast(Row, super().__next__())
65
+
66
+ def next(self) -> Row:
67
+ """Python 2 compatibility alias for ``__next__``. Returns a tuple row.
68
+
69
+ Raises:
70
+ StopIteration: When no more rows are available
71
+ """
72
+ return self.__next__()
@@ -0,0 +1,7 @@
1
+ """BACKWARD COMPATIBILITY MODULE ONLY"""
2
+
3
+ import platform
4
+
5
+
6
+ OPERATING_SYSTEM = platform.system()
7
+ PLATFORM = platform.platform()