Skip to content

Commit

Permalink
SNOW-1039216: add default memory pool for pyarrow (#1879)
Browse files Browse the repository at this point in the history
* SNOW-1039216: add default memory pool for pyarrow

* SNOW-1039216: add docstring; don't change default value if already set
  • Loading branch information
sfc-gh-aalam authored Feb 26, 2024
1 parent 7b7bbeb commit b2d6ce3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/snowflake/connector/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import annotations

import importlib
import os
import warnings
from importlib.metadata import distributions
from logging import getLogger
Expand Down Expand Up @@ -79,6 +80,10 @@ def _import_or_missing_pandas_option() -> (

pyarrow = importlib.import_module("pyarrow")

# set default memory pool to system for pyarrow to_pandas conversion
if "ARROW_DEFAULT_MEMORY_POOL" not in os.environ:
os.environ["ARROW_DEFAULT_MEMORY_POOL"] = "system"

# Check whether we have the currently supported pyarrow installed
installed_packages = {
package.metadata["Name"]: package for package in distributions()
Expand Down

0 comments on commit b2d6ce3

Please sign in to comment.