Skip to content

Test PR-2312 #2319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
- v3.16(TBD)
- Added basic arrow support for Interval types.
- Fix `write_pandas` special characters usage in the location name.
- Ensure the converter runs to_snowflake on list items.

- v3.15.0(Apr 29,2025)
- Bumped up min boto and botocore version to 1.24.
Expand Down
4 changes: 2 additions & 2 deletions src/snowflake/connector/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ def _decimal_to_snowflake(self, value: decimal.Decimal) -> str | None:

def _list_to_snowflake(self, value: list) -> list:
return [
SnowflakeConverter.quote(v0)
for v0 in [SnowflakeConverter.escape(v) for v in value]
SnowflakeConverter.quote(SnowflakeConverter.escape(self.to_snowflake(v)))
for v in value
]

_tuple_to_snowflake = _list_to_snowflake
Expand Down
8 changes: 8 additions & 0 deletions test/unit/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from datetime import timedelta
from decimal import Decimal
from logging import getLogger
from uuid import UUID

import numpy
import pytest
Expand Down Expand Up @@ -77,6 +78,13 @@ def test_more_timestamps():
assert m("-2208943503.0120000") == "1900-01-01 12:34:56.988000000"


def test_converter_to_snowflake_bytes():
uuid = UUID("12345678-1234-5678-1234-567812345678")

converter = SnowflakeConverter()
assert converter.to_snowflake([uuid.bytes]) == ["X'\x124Vx\x124Vx\x124Vx\x124Vx'"]


def test_converter_to_snowflake_error():
converter = SnowflakeConverter()
with pytest.raises(
Expand Down
Loading