Skip to content

Commit 355b796

Browse files
committed
SNOW-2306184: config refactor - cleanup 4
1 parent 6772a15 commit 355b796

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/snowflake/cli/api/config_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def invalidate_cache(self) -> None:
637637
self._last_config_override = None
638638

639639

640-
def _is_alternative_config_enabled() -> bool:
640+
def is_alternative_config_enabled() -> bool:
641641
"""
642642
Check if alternative configuration handling is enabled via environment variable.
643643
Does not use the built-in feature flags mechanism.
@@ -655,7 +655,7 @@ def get_config_provider() -> ConfigProvider:
655655
Factory function to get the appropriate configuration provider
656656
based on environment variable.
657657
"""
658-
if _is_alternative_config_enabled():
658+
if is_alternative_config_enabled():
659659
return AlternativeConfigProvider()
660660
return LegacyConfigProvider()
661661

tests/test_config.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,13 @@
2828
get_env_variable_name,
2929
set_config_value,
3030
)
31+
from snowflake.cli.api.config_provider import is_alternative_config_enabled
3132
from snowflake.cli.api.exceptions import MissingConfigurationError
3233

3334
from tests.testing_utils.files_and_dirs import assert_file_permissions_are_strict
3435
from tests_common import IS_WINDOWS
3536

3637

37-
def is_config_ng_enabled():
38-
"""Check if config_ng is enabled via environment variable"""
39-
return os.getenv("SNOWFLAKE_CLI_CONFIG_V2_ENABLED") == "true"
40-
41-
4238
def test_empty_config_file_is_created_if_not_present():
4339
from snowflake.cli.api.utils.path_utils import path_resolver
4440

@@ -390,7 +386,7 @@ def assert_correct_connections_loaded():
390386

391387
# Legacy version - skip when config_ng is enabled
392388
@pytest.mark.skipif(
393-
is_config_ng_enabled(),
389+
is_alternative_config_enabled(),
394390
reason="Legacy behavior: connections.toml replaces all connections from config.toml",
395391
)
396392
def test_connections_toml_override_config_toml_legacy(
@@ -413,7 +409,7 @@ def test_connections_toml_override_config_toml_legacy(
413409

414410
# Config_ng version - skip when config_ng is NOT enabled
415411
@pytest.mark.skipif(
416-
not is_config_ng_enabled(),
412+
not is_alternative_config_enabled(),
417413
reason="Config_ng behavior: connections.toml merges with config.toml per-key",
418414
)
419415
def test_connections_toml_override_config_toml_config_ng(

0 commit comments

Comments
 (0)