From c3934353ea179a65d72a865c85b181bd99bd9541 Mon Sep 17 00:00:00 2001 From: Michel El Nacouzi Date: Tue, 3 Dec 2024 11:50:24 -0500 Subject: [PATCH] Address comments --- src/snowflake/cli/_plugins/connection/util.py | 2 ++ src/snowflake/cli/_plugins/nativeapp/sf_sql_facade.py | 3 +-- src/snowflake/cli/api/config.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/snowflake/cli/_plugins/connection/util.py b/src/snowflake/cli/_plugins/connection/util.py index b2adef6a8e..45c6873e0a 100644 --- a/src/snowflake/cli/_plugins/connection/util.py +++ b/src/snowflake/cli/_plugins/connection/util.py @@ -79,6 +79,8 @@ def get_ui_parameters(conn: SnowflakeConnection) -> Dict[UIParameter, Any]: parameters_to_fetch = [param.value for param in UIParameter] + # Parsing of the Json and the filtering is happening here in Snowflake CLI + # in order to avoid requiring a warehouse in Snowflake query = "call system$bootstrap_data_request('CLIENT_PARAMS_INFO')" *_, cursor = conn.execute_string(query) diff --git a/src/snowflake/cli/_plugins/nativeapp/sf_sql_facade.py b/src/snowflake/cli/_plugins/nativeapp/sf_sql_facade.py index f5c26ec898..e0fdbdb284 100644 --- a/src/snowflake/cli/_plugins/nativeapp/sf_sql_facade.py +++ b/src/snowflake/cli/_plugins/nativeapp/sf_sql_facade.py @@ -18,6 +18,7 @@ from textwrap import dedent from typing import Any, Dict, List +from snowflake.cli._plugins.connection.util import UIParameter, get_ui_parameter from snowflake.cli._plugins.nativeapp.constants import ( AUTHORIZE_TELEMETRY_COL, NAME_COL, @@ -26,8 +27,6 @@ from snowflake.cli._plugins.nativeapp.same_account_install_method import ( SameAccountInstallMethod, ) -from snowflake.cli._plugins.connection.util import UIParameter, get_ui_parameter -from snowflake.cli._plugins.nativeapp.constants import SPECIAL_COMMENT from snowflake.cli._plugins.nativeapp.sf_facade_constants import UseObjectType from snowflake.cli._plugins.nativeapp.sf_facade_exceptions import ( CREATE_OR_UPGRADE_APPLICATION_EXPECTED_USER_ERROR_CODES, diff --git a/src/snowflake/cli/api/config.py b/src/snowflake/cli/api/config.py index 0b5111f3ef..0a03c36b97 100644 --- a/src/snowflake/cli/api/config.py +++ b/src/snowflake/cli/api/config.py @@ -286,10 +286,10 @@ def get_config_value(*path, key: str, default: Optional[Any] = Empty) -> Any: raise -def get_config_bool_value(*path, key: str, default: Any = Empty) -> bool | None: +def get_config_bool_value(*path, key: str, default: Optional[bool]) -> Optional[bool]: value = get_config_value(*path, key=key, default=None) - if value is None and default is not Empty: + if value is None: return default try: