Skip to content

Commit 797fa33

Browse files
Linting fix for CI to pass
1 parent 4c123c9 commit 797fa33

File tree

2 files changed

+7
-38
lines changed

2 files changed

+7
-38
lines changed

src/snowflake/connector/aio/_pandas_tools.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
from snowflake.connector import ProgrammingError
1010
from snowflake.connector.options import pandas
11+
12+
# Import utilities from sync version
13+
from snowflake.connector.pandas_tools import (
14+
_iceberg_config_statement_helper,
15+
build_location_helper,
16+
chunk_helper,
17+
)
1118
from snowflake.connector.telemetry import TelemetryData, TelemetryField
1219

1320
from .._utils import (
@@ -16,13 +23,6 @@
1623
random_name_for_temp_object,
1724
)
1825
from ..constants import _PARAM_USE_SCOPED_TEMP_FOR_PANDAS_TOOLS
19-
20-
# Import utilities from sync version
21-
from ..pandas_tools import (
22-
_iceberg_config_statement_helper,
23-
build_location_helper,
24-
chunk_helper,
25-
)
2626
from ._cursor import SnowflakeCursor
2727

2828
if TYPE_CHECKING: # pragma: no cover

test/integ/aio_it/test_pandas_tools_async.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import annotations
33

44
import math
5-
import re
65
from datetime import datetime, timedelta, timezone
76
from typing import TYPE_CHECKING, Any, Callable, Generator
87
from unittest import mock
@@ -24,11 +23,9 @@
2423
try:
2524
from snowflake.connector.aio._pandas_tools import write_pandas
2625
from snowflake.connector.options import pandas
27-
from snowflake.connector.pandas_tools import _iceberg_config_statement_helper
2826
except ImportError:
2927
pandas = None
3028
write_pandas = None
31-
_iceberg_config_statement_helper = None
3229

3330
if TYPE_CHECKING:
3431
from snowflake.connector.aio import SnowflakeConnection
@@ -1053,34 +1050,6 @@ async def mock_execute(*args, **kwargs):
10531050
await cnx.execute_string(f"drop schema if exists {target_schema}")
10541051

10551052

1056-
def test__iceberg_config_statement_helper():
1057-
config = {
1058-
"EXTERNAL_VOLUME": "vol",
1059-
"CATALOG": "'SNOWFLAKE'",
1060-
"BASE_LOCATION": "/root",
1061-
"CATALOG_SYNC": "foo",
1062-
"STORAGE_SERIALIZATION_POLICY": "bar",
1063-
}
1064-
assert (
1065-
_iceberg_config_statement_helper(config)
1066-
== "EXTERNAL_VOLUME='vol' CATALOG='SNOWFLAKE' BASE_LOCATION='/root' CATALOG_SYNC='foo' STORAGE_SERIALIZATION_POLICY='bar'"
1067-
)
1068-
1069-
config["STORAGE_SERIALIZATION_POLICY"] = None
1070-
assert (
1071-
_iceberg_config_statement_helper(config)
1072-
== "EXTERNAL_VOLUME='vol' CATALOG='SNOWFLAKE' BASE_LOCATION='/root' CATALOG_SYNC='foo'"
1073-
)
1074-
1075-
config["foo"] = True
1076-
config["bar"] = True
1077-
with pytest.raises(
1078-
ProgrammingError,
1079-
match=re.escape("Invalid iceberg configurations option(s) provided BAR, FOO"),
1080-
):
1081-
_iceberg_config_statement_helper(config)
1082-
1083-
10841053
async def test_write_pandas_with_on_error(
10851054
conn_cnx: Callable[..., Generator[SnowflakeConnection]],
10861055
):

0 commit comments

Comments
 (0)