How to kill a query running by pd.read_sql and connected by sqlalchemy (or mysql.connector)

66
March 04, 2021, at 07:10 AM

I have a Python API that receives a request from PHP code and executes some queries with pd.read_sql() in a MariaDB 10.3 (The connection object argument is made by sqlalchemy, but I can use mysql.connector, or any other if necessary to solve this)

The thing is, sometimes the query generated can be too slow to process, and I want to interrupt it. (or for any other reason)

I want to add a default fixed timeout but I ALSO need to be able to interrupt the query anytime I want. With the starting command to interrupt coming from the Web Page.

Is there any ID I can get from the connection object ? so I can use it in a parallel request to force the database query to stop. Or any other better approach to this situation that I'm not aware of ?

Thanks in advance.

READ ALSO
How to run a file in VS Code?

How to run a file in VS Code?

I am learning PHP and I have decided to use VS CodeIs there any way I can run the files without a compiler? I have looked in the output section but nothing is there

61
Kotlin - OnSharedPreferenceChangeListener

Kotlin - OnSharedPreferenceChangeListener

I learn to develop my first Android appI choose Kotlin, just because

68
Is it possible to zip up and send a local (to the app) directory without requiring the user to select one?

Is it possible to zip up and send a local (to the app) directory without requiring the user to select one?

I'm attempting to create an app that can access a directory in the app's directory, zip it with JSZip and send it to an API at the press of a single button

70
Check if Column exceeding specific value and replace

Check if Column exceeding specific value and replace

I use the long list of codes similar to below codes, to check data frame with multiple columns

43