@@ -76,50 +76,50 @@ async def connect_and_provide_credentials(
7676 ):
7777 import asyncio
7878
79- try :
80- # Start connection as an async task in the main event loop
81- # This allows the browser to be opened from the main thread context
82- connect_task = asyncio .create_task (self .connect_and_execute_simple_query ())
83-
84- if self .auth_test_env == "docker" :
85- # Give connection time to start and open the browser
86- await asyncio .sleep (5 )
87-
88- # Run browser automation in a thread
89- loop = asyncio .get_running_loop ()
90- await loop .run_in_executor (
91- None ,
92- self ._provide_credentials ,
93- scenario ,
94- login ,
95- password ,
96- )
79+ # try:
80+ # Start connection as an async task in the main event loop
81+ # This allows the browser to be opened from the main thread context
82+ connect_task = asyncio .create_task (self .connect_and_execute_simple_query ())
9783
98- # Wait for connection to complete
99- await connect_task
84+ if self .auth_test_env == "docker" :
85+ # Give connection time to start and open the browser
86+ await asyncio .sleep (5 )
87+
88+ # Run browser automation in a thread
89+ loop = asyncio .get_running_loop ()
90+ await loop .run_in_executor (
91+ None ,
92+ self ._provide_credentials ,
93+ scenario ,
94+ login ,
95+ password ,
96+ )
10097
101- except Exception as e :
102- self .error_msg = e
103- logger .error (e )
98+ # Wait for connection to complete
99+ await connect_task
100+
101+ # except Exception as e:
102+ # self.error_msg = e
103+ # logger.error(e)
104104
105105 def get_error_msg (self ) -> str :
106106 return str (self .error_msg )
107107
108108 async def connect_and_execute_simple_query (self ):
109- try :
110- logger .info ("Trying to connect to Snowflake" )
111- async with snowflake .connector .aio .SnowflakeConnection (
112- ** self .configuration
113- ) as con :
114- logger .info ("Connected to Snowflake, executing query" )
115- result = await con .cursor ().execute ("select 1;" )
116- logger .debug (await result .fetchall ())
117- logger .info ("Successfully connected to Snowflake" )
118- return True
119- except Exception as e :
120- self .error_msg = e
121- logger .error (e )
122- return False
109+ # try:
110+ logger .info ("Trying to connect to Snowflake" )
111+ async with snowflake .connector .aio .SnowflakeConnection (
112+ ** self .configuration
113+ ) as con :
114+ logger .info ("Connected to Snowflake, executing query" )
115+ result = await con .cursor ().execute ("select 1;" )
116+ logger .debug (await result .fetchall ())
117+ logger .info ("Successfully connected to Snowflake" )
118+ return True
119+ # except Exception as e:
120+ # self.error_msg = e
121+ # logger.error(e)
122+ # return False
123123
124124 async def connect_and_execute_set_session_state (self , key : str , value : str ):
125125 try :
0 commit comments