|
2 | 2 | from __future__ import annotations |
3 | 3 |
|
4 | 4 | import math |
5 | | -import re |
6 | 5 | from datetime import datetime, timedelta, timezone |
7 | 6 | from typing import TYPE_CHECKING, Any, Callable, Generator |
8 | 7 | from unittest import mock |
|
24 | 23 | try: |
25 | 24 | from snowflake.connector.aio._pandas_tools import write_pandas |
26 | 25 | from snowflake.connector.options import pandas |
27 | | - from snowflake.connector.pandas_tools import _iceberg_config_statement_helper |
28 | 26 | except ImportError: |
29 | 27 | pandas = None |
30 | 28 | write_pandas = None |
31 | | - _iceberg_config_statement_helper = None |
32 | 29 |
|
33 | 30 | if TYPE_CHECKING: |
34 | 31 | from snowflake.connector.aio import SnowflakeConnection |
@@ -1053,34 +1050,6 @@ async def mock_execute(*args, **kwargs): |
1053 | 1050 | await cnx.execute_string(f"drop schema if exists {target_schema}") |
1054 | 1051 |
|
1055 | 1052 |
|
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 | | - |
1084 | 1053 | async def test_write_pandas_with_on_error( |
1085 | 1054 | conn_cnx: Callable[..., Generator[SnowflakeConnection]], |
1086 | 1055 | ): |
|
0 commit comments