Skip to content

Commit b2d6ce3

Browse files
authored
SNOW-1039216: add default memory pool for pyarrow (#1879)
* SNOW-1039216: add default memory pool for pyarrow * SNOW-1039216: add docstring; don't change default value if already set
1 parent 7b7bbeb commit b2d6ce3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/snowflake/connector/options.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from __future__ import annotations
66

77
import importlib
8+
import os
89
import warnings
910
from importlib.metadata import distributions
1011
from logging import getLogger
@@ -79,6 +80,10 @@ def _import_or_missing_pandas_option() -> (
7980

8081
pyarrow = importlib.import_module("pyarrow")
8182

83+
# set default memory pool to system for pyarrow to_pandas conversion
84+
if "ARROW_DEFAULT_MEMORY_POOL" not in os.environ:
85+
os.environ["ARROW_DEFAULT_MEMORY_POOL"] = "system"
86+
8287
# Check whether we have the currently supported pyarrow installed
8388
installed_packages = {
8489
package.metadata["Name"]: package for package in distributions()

0 commit comments

Comments
 (0)