MCPcopy Create free account
hub / github.com/apache/impala / ScopedSession

Function ScopedSession

tests/hs2/test_hs2.py:54–64  ·  view source on GitHub ↗
(hs2_client, *args, **kwargs)

Source from the content-addressed store, hash-verified

52# direct access to the TOpenSessionReq parameters.
53@contextmanager
54def ScopedSession(hs2_client, *args, **kwargs):
55 try:
56 open_session_req = TCLIService.TOpenSessionReq(*args, **kwargs)
57 session = hs2_client.OpenSession(open_session_req)
58 yield session
59 finally:
60 if session.status.statusCode != TCLIService.TStatusCode.SUCCESS_STATUS:
61 return
62 close_session_req = TCLIService.TCloseSessionReq()
63 close_session_req.sessionHandle = session.sessionHandle
64 HS2TestSuite.check_response(hs2_client.CloseSession(close_session_req))
65
66
67class TestHS2(HS2TestSuite):

Calls 3

check_responseMethod · 0.80
OpenSessionMethod · 0.45
CloseSessionMethod · 0.45

Tested by

no test coverage detected