betodealmeida commented on code in PR #31265:
URL: https://github.com/apache/superset/pull/31265#discussion_r1869935329


##########
superset/db_engine_specs/trino.py:
##########
@@ -283,6 +286,8 @@ def _execute(
         )
         execute_thread.start()
 
+        # Wait for the thread to start before continuing
+        time.sleep(0.1)

Review Comment:
   You might also be able to use an event `.wait` instead of `sleep`:
   
   ```python
       while not execute_event.is_set():
               if cursor.query_id:
                   break
               execute_event.wait(0.1)
   ```



##########
superset/db_engine_specs/trino.py:
##########
@@ -283,6 +286,8 @@ def _execute(
         )
         execute_thread.start()
 
+        # Wait for the thread to start before continuing
+        time.sleep(0.1)

Review Comment:
   You might also be able to use an event `.wait` instead of `sleep`:
   
   ```python
           while not execute_event.is_set():
               if cursor.query_id:
                   break
               execute_event.wait(0.1)
   ```



-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to