dosubot[bot] commented on issue #29270:
URL: https://github.com/apache/superset/issues/29270#issuecomment-2173448278

   <!-- Greeting -->
   Hey @berlicon! I'm here to assist you with any bugs, questions, and 
contribute to the repository. Let's tackle this issue together!
   
   <!-- Answer -->
   To resolve the "ClickHouse Connect (Superset) Error - expected string or 
bytes-like object" when executing the `KILL QUERY` command in Superset/SQL Lab 
connected to a ClickHouse database, ensure that the parameters passed to the 
command are of the correct type (string or bytes-like object). 
   
   Here's a code snippet to properly format the `KILL QUERY` command:
   
   ```python
   query_id = "091f6bf3-18b4-4977-89e7-ac9a038a242f"  # Ensure this is a string
   kill_query_command = f"KILL QUERY WHERE query_id = '{query_id}'"
   
   # Execute the command
   database.execute(kill_query_command)
   ```
   
   Make sure that `query_id` is a string. If `query_id` is obtained from 
another source, convert it to a string before using it in the `KILL QUERY` 
command.
   
   If the issue persists, check the implementation of the `execute` method in 
your database connection to ensure it correctly handles the `KILL QUERY` 
command 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/db_engine_specs/clickhouse.py)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
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