Skip to content

Commit cc867aa

Browse files
authored
SNOW-2173685 respect existing param control of using SCOPED keyword f… (#2374)
1 parent 259074f commit cc867aa

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/snowflake/connector/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
_TOP_LEVEL_DOMAIN_REGEX = r"\.[a-zA-Z]{1,63}$"
3838
_SNOWFLAKE_HOST_SUFFIX_REGEX = r"snowflakecomputing(\.[a-zA-Z]{1,63}){1,2}$"
3939

40+
_PARAM_USE_SCOPED_TEMP_FOR_PANDAS_TOOLS = "ENABLE_FIX_1375538"
41+
4042

4143
class FieldType(NamedTuple):
4244
name: str

src/snowflake/connector/pandas_tools.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
from snowflake.connector.telemetry import TelemetryData, TelemetryField
2323

2424
from ._utils import (
25-
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING,
2625
TempObjectType,
2726
get_temp_type_for_object,
2827
random_name_for_temp_object,
2928
)
29+
from .constants import _PARAM_USE_SCOPED_TEMP_FOR_PANDAS_TOOLS
3030
from .cursor import SnowflakeCursor
3131

3232
if TYPE_CHECKING: # pragma: no cover
@@ -353,20 +353,13 @@ def write_pandas(
353353
f"Invalid compression '{compression}', only acceptable values are: {compression_map.keys()}"
354354
)
355355

356+
# TODO(SNOW-1505026): Get rid of this when the BCR to always create scoped temp for intermediate results is done.
356357
_use_scoped_temp_object = (
357-
conn._session_parameters.get(
358-
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING, False
359-
)
358+
conn._session_parameters.get(_PARAM_USE_SCOPED_TEMP_FOR_PANDAS_TOOLS, False)
360359
if conn._session_parameters
361360
else False
362361
)
363362

364-
"""sfc-gh-yixie: scoped temp stage isn't required out side of a SP.
365-
TODO: remove the following line when merging SP connector and Python Connector.
366-
Make sure `create scoped temp stage` is supported when it's not run in a SP.
367-
"""
368-
_use_scoped_temp_object = False
369-
370363
if create_temp_table:
371364
warnings.warn(
372365
"create_temp_table is deprecated, we still respect this parameter when it is True but "

0 commit comments

Comments
 (0)