Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
- Added a feature to verify if the connection is still good enough to send queries over.
- Added support for base64-encoded DER private key strings in the `private_key` authentication type.

- v3.12.5(TBD)
- Added a feature to limit the sizes of IO-bound ThreadPoolExecutors during PUT and GET commands.

- v3.12.4(December 3,2024)
- Fixed a bug where multipart uploads to Azure would be missing their MD5 hashes.
- Fixed a bug where OpenTelemetry header injection would sometimes cause Exceptions to be thrown.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def build_extension(self, ext):
"CArrowIterator.cpp",
"CArrowTableIterator.cpp",
"DateConverter.cpp",
"DecFloatConverter.cpp",
"DecimalConverter.cpp",
"FixedSizeListConverter.cpp",
"FloatConverter.cpp",
Expand Down
16 changes: 8 additions & 8 deletions src/snowflake/connector/aio/auth/_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
from typing import TYPE_CHECKING, Any, Callable

from ...auth import Auth as AuthSync
from ...auth._auth import (
AUTHENTICATION_REQUEST_KEY_WHITELIST,
ID_TOKEN,
MFA_TOKEN,
delete_temporary_credential,
)
from ...auth._auth import AUTHENTICATION_REQUEST_KEY_WHITELIST
from ...compat import urlencode
from ...constants import (
HTTP_HEADER_ACCEPT,
Expand All @@ -43,6 +38,7 @@
ReauthenticationRequest,
)
from ...sqlstate import SQLSTATE_CONNECTION_WAS_NOT_ESTABLISHED
from ...token_cache import TokenType
from ._no_auth import AuthNoAuth

if TYPE_CHECKING:
Expand Down Expand Up @@ -280,7 +276,9 @@ async def post_request_wrapper(self, url, headers, body) -> None:
# clear stored id_token if failed to connect because of id_token
# raise an exception for reauth without id_token
self._rest.id_token = None
delete_temporary_credential(self._rest._host, user, ID_TOKEN)
self.delete_temporary_credential(
self._rest._host, user, TokenType.ID_TOKEN
)
raise ReauthenticationRequest(
ProgrammingError(
msg=ret["message"],
Expand All @@ -301,7 +299,9 @@ async def post_request_wrapper(self, url, headers, body) -> None:
from . import AuthByUsrPwdMfa

if isinstance(auth_instance, AuthByUsrPwdMfa):
delete_temporary_credential(self._rest._host, user, MFA_TOKEN)
self.delete_temporary_credential(
self._rest._host, user, TokenType.MFA_TOKEN
)
Error.errorhandler_wrapper(
self._rest._connection,
None,
Expand Down
8 changes: 8 additions & 0 deletions src/snowflake/connector/arrow_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,11 @@ def DECIMAL128_to_decimal(self, int128_bytes: bytes, scale: int) -> decimal.Deci
digits = [int(digit) for digit in str(int128) if digit != "-"]
sign = int128 < 0
return decimal.Decimal((sign, digits, -scale))

def DECFLOAT_to_decimal(self, exponent: int, significand: bytes) -> decimal.Decimal:
# significand is two's complement big endian.
significand = int.from_bytes(significand, byteorder="big", signed=True)
return decimal.Decimal(significand).scaleb(exponent)

def DECFLOAT_to_numpy_float64(self, exponent: int, significand: bytes) -> float64:
return numpy.float64(self.DECFLOAT_to_decimal(exponent, significand))
Loading
Loading