I have some python code that I am trying to use to read uncommitted from my database in parallel using sqlalchemy and modin. I have tried calling the function as: df = pd.read_sql("select * from my_table", uri_string, params={'isolation_level': 'READ UNCOMMITTED'})
. However, I am seeing the generated queries submitted without an isolation level to my database. Has anyone been able to inject the isolation level without creating an sqlalchemy engine before calling read_sql?
EDIT: Unlike pandas, modin's implementation allows read_sql to run in parallel. Part of that implementation means that whatever query I write will be wrapped into several subqueries like select * from (select * from my_table) limit 100 offset 200;
. Therefore, statement level isolation is off the table without adjusting this implementation.
Further, this implementation requires an sqlalchemy URI string rather than an engine or connection which can be serialized by many workers. Therefore, I would need to know how to inject the isolation level parameter within the URI string if I were to set the isolation level from the connection string.