@@ -137,7 +137,6 @@ def run_query(
137
137
# inject parameters
138
138
params ["config" ]["token" ] = self ._get_or_request_token ()
139
139
params ["config" ]["arrowEndpoint" ] = self ._uri
140
- print (params )
141
140
142
141
return self ._fallback_query_runner .run_query (query , params , database , custom_error )
143
142
@@ -194,17 +193,13 @@ def create_graph_constructor(
194
193
)
195
194
196
195
def _get_or_request_token (self ) -> str :
197
- print ("get or request token" )
198
196
self ._flight_client .authenticate_basic_token (self ._auth [0 ], self ._auth [1 ])
199
197
return self ._auth_factory .token ()
200
198
201
199
202
200
class AuthFactory (ClientMiddlewareFactory ): # type: ignore
203
201
def __init__ (self , auth : Tuple [str , str ], * args : Any , ** kwargs : Any ) -> None :
204
202
super ().__init__ (* args , ** kwargs )
205
- print ("init auth factory" )
206
-
207
-
208
203
self ._auth = auth
209
204
self ._token : Optional [str ] = None
210
205
self ._token_timestamp = 0
@@ -213,7 +208,6 @@ def start_call(self, info: Any) -> "AuthMiddleware":
213
208
return AuthMiddleware (self )
214
209
215
210
def token (self ) -> Optional [str ]:
216
- print (f"current token { self ._token } at { self ._token_timestamp } " )
217
211
# check whether the token is older than 10 minutes. If so, reset it.
218
212
if self ._token and int (time .time ()) - self ._token_timestamp > 600 :
219
213
self ._token = None
@@ -224,8 +218,6 @@ def set_token(self, token: str) -> None:
224
218
self ._token = token
225
219
self ._token_timestamp = int (time .time ())
226
220
227
- print (f"set token { self ._token } time_stamp: { self ._token_timestamp } " )
228
-
229
221
@property
230
222
def auth (self ) -> Tuple [str , str ]:
231
223
return self ._auth
@@ -250,8 +242,6 @@ def received_headers(self, headers: Dict[str, Any]) -> None:
250
242
self ._factory .set_token (token )
251
243
252
244
def sending_headers (self ) -> Dict [str , str ]:
253
- print ("sending headers" )
254
-
255
245
token = self ._factory .token ()
256
246
if not token :
257
247
username , password = self ._factory .auth
0 commit comments