11import json
22from subprocess import CalledProcessError , run
3- from typing import Any , Dict , Optional , cast
3+ from typing import Optional
44
55from .exception import RSConnectException
66from .log import logger
@@ -13,7 +13,7 @@ def snow(*args: str):
1313
1414def ensure_snow_installed () -> None :
1515 try :
16- import snowflake .cli
16+ import snowflake .cli # noqa
1717
1818 logger .debug ("snowflake-cli is installed." )
1919
@@ -33,7 +33,7 @@ def list_connections():
3333 res = snow ("connection" , "list" , "--format" , "json" )
3434 connection_list = json .loads (res .stdout )
3535 return connection_list
36- except :
36+ except CalledProcessError :
3737 raise RSConnectException ("Could not list snowflake connections." )
3838
3939
@@ -64,7 +64,7 @@ def generate_jwt(name: Optional[str] = None):
6464 res = snow ("connection" , "generate-jwt" , "--connection" , connection_name , "--format" , "json" )
6565 try :
6666 output = json .loads (res .stdout )
67- except json .JSONDecodeError as e :
67+ except json .JSONDecodeError :
6868 raise RSConnectException (f"Failed to parse JSON from snow-cli: { res .stdout } " )
6969 jwt = output .get ("message" )
7070 if jwt is None :
0 commit comments