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

Method __exit__

tests/util/cancel_util.py:56–74  ·  view source on GitHub ↗
(self, exc_type, exc_value, traceback)

Source from the content-addressed store, hash-verified

54 return self.client.handle_id(self.handle)
55
56 def __exit__(self, exc_type, exc_value, traceback): # noqa: U100
57 self.poll_thread.join()
58 if not self.check_on_exit:
59 self.client.close()
60 return
61 # If ImpalaServer::UnregisterQuery() happens before the last polling, the error
62 # message will be "Invalid or unknown query handle". Otherwise, the error message
63 # will be "Cancelled".
64 assert error_msg_startswith(
65 str(self.exc),
66 ["Invalid or unknown query handle", "Cancelled"],
67 self.client.handle_id(self.handle),
68 )
69 try:
70 self.client.fetch(self.sql, self.handle)
71 except Exception as ex:
72 assert "Invalid or unknown query handle" in str(ex) or "Cancelled" in str(ex)
73 finally:
74 self.client.close()
75
76
77def assert_kill_ok(client, query_id, user=None):

Callers

nothing calls this directly

Calls 5

error_msg_startswithFunction · 0.90
closeMethod · 0.65
joinMethod · 0.45
handle_idMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected