From 1f8b3f456d072028dcecbd2790b9e95a4f159f75 Mon Sep 17 00:00:00 2001 From: Luis Montero Marin Date: Mon, 8 Apr 2024 13:13:21 -0600 Subject: [PATCH] Fix unit tests --- src/snowflake/cli/app/snow_connector.py | 5 ++++- tests/test_connection.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/snowflake/cli/app/snow_connector.py b/src/snowflake/cli/app/snow_connector.py index cf43ccb2d6..849a219992 100644 --- a/src/snowflake/cli/app/snow_connector.py +++ b/src/snowflake/cli/app/snow_connector.py @@ -78,7 +78,10 @@ def connect_to_snowflake( ] = diag_allowlist_path if ( - overrides["session_token"] and overrides["master_token"] + "session_token" in overrides + and overrides["session_token"] is not None + and "master_token" in overrides + and overrides["master_token"] is not None ): # TODO (lmonteromarin): Confirm this works as intended connection_parameters["server_session_keep_alive"] = True diff --git a/tests/test_connection.py b/tests/test_connection.py index 62f0474e5e..b10d4aa777 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -474,6 +474,7 @@ def test_session_and_master_tokens(mock_connector, mock_ctx, runner): database="test_dv", schema="PUBLIC", warehouse="xsmall", + server_session_keep_alive=True, )