bito-code-review[bot] commented on code in PR #44714:
URL: https://github.com/apache/superset/pull/44714#discussion_r4131051908
##########
superset/db_engine_specs/impala.py:
##########
@@ -128,6 +128,27 @@ def execute(
except Exception as ex:
raise cls.get_dbapi_mapped_exception(ex) from ex
+ @classmethod
+ def fetch_data(cls, cursor: Any, limit: int | None = None) ->
list[tuple[Any, ...]]:
+ """Wait for asynchronous operations using the public cursor API."""
+ if callable(getattr(cursor, "execute_async", None)):
+ from impala.error import Error
+
+ deadline = time.monotonic() + app.config["SQLLAB_TIMEOUT"]
+ try:
+ while cursor.is_executing():
+ if time.monotonic() >= deadline:
+ cursor.cancel_operation()
+ raise TimeoutError("Timed out waiting for the Impala
operation")
+ time.sleep(0.1)
Review Comment:
<!-- Bito Reply -->
The analysis provided in the thread correctly identifies that the proposed
changes in the pull request are intentional and that the suggested polling
optimization is optional. The concerns regarding the cancellation race and
error handling have been addressed by the reviewer's validation against the
driver implementation, confirming that the current logic does not swallow
errors or misreport timeouts. No further code changes are required for this
specific area.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]