(self, exc_type, exc_value, traceback)
| 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 | |
| 77 | def assert_kill_ok(client, query_id, user=None): |
nothing calls this directly
no test coverage detected