Skip to content

Commit 93f62cf

Browse files
committed
SNOW-2306184: config refactory - move key mappings to module level
1 parent a0c7653 commit 93f62cf

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/snowflake/cli/api/config_ng/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
ValueSource,
3131
)
3232
from snowflake.cli.api.config_ng.env_handlers import (
33+
SNOWSQL_TO_SNOWCLI_KEY_MAPPINGS,
3334
SnowCliEnvHandler,
3435
SnowSqlEnvHandler,
3536
)
@@ -49,6 +50,7 @@
4950
"ResolutionEntry",
5051
"ResolutionHistory",
5152
"SnowCliEnvHandler",
53+
"SNOWSQL_TO_SNOWCLI_KEY_MAPPINGS",
5254
"SnowSqlEnvHandler",
5355
"SourcePriority",
5456
"ValueSource",

src/snowflake/cli/api/config_ng/env_handlers.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
from snowflake.cli.api.config_ng.core import ConfigValue, SourcePriority
2929
from snowflake.cli.api.config_ng.handlers import SourceHandler
3030

31+
# Key mappings from SnowSQL to SnowCLI naming conventions
32+
# These mappings are used by handlers that need to support SnowSQL compatibility
33+
SNOWSQL_TO_SNOWCLI_KEY_MAPPINGS: Dict[str, str] = {
34+
"pwd": "password",
35+
}
36+
3137

3238
class SnowCliEnvHandler(SourceHandler):
3339
"""
@@ -124,11 +130,8 @@ class SnowSqlEnvHandler(SourceHandler):
124130

125131
PREFIX = "SNOWSQL_"
126132

127-
# Key mappings from SnowSQL to SnowCLI
128-
# SnowSQL uses PWD, but SnowCLI uses PASSWORD
129-
KEY_MAPPINGS: Dict[str, str] = {
130-
"pwd": "password",
131-
}
133+
# Reference to module-level key mappings
134+
KEY_MAPPINGS = SNOWSQL_TO_SNOWCLI_KEY_MAPPINGS
132135

133136
@property
134137
def source_name(self) -> str:

0 commit comments

Comments
 (0)