Skip to content

Commit 65396a8

Browse files
authored
Re-word backend selection warning. (#708)
1 parent de312ea commit 65396a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sparse/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ class BackendType(Enum):
1414

1515
_ENV_VAR_NAME = "SPARSE_BACKEND"
1616

17-
if _ENV_VAR_NAME in os.environ:
18-
warnings.warn("Selectable backends feature in `sparse` might change in the future.", FutureWarning, stacklevel=1)
17+
if os.environ.get(_ENV_VAR_NAME, "") != "":
18+
warnings.warn(
19+
"Changing back-ends is a development feature, please do not rely on it in production.",
20+
FutureWarning,
21+
stacklevel=1,
22+
)
1923
_backend_name = os.environ[_ENV_VAR_NAME]
2024
else:
2125
_backend_name = BackendType.Numba.value

0 commit comments

Comments
 (0)