GitHub user jx2lee edited a discussion: What is best way to change isolation 
level in MySqlHook (`get_pandas_df`)

Hey, airflow community!
I have question of best way to use MySqlHook!

- We've EL pipeline using Airflow Custom Operator, often used `MySqlHook`.
- 
hook.[get_pandas_df](https://github.com/apache/airflow/blob/88d3c357c513f419737c7abe85d12bcabc810ea1/providers/src/airflow/providers/common/sql/hooks/sql.py#L294)
 is important in our pipeline! (selected by chunk size, concating more and 
more!)
- db(source) isolation level is repeatable read, but we need to change 
isolation level when extract source(to `READ COMITTED`!!).
- but due to [this 
line](https://github.com/apache/airflow/blob/88d3c357c513f419737c7abe85d12bcabc810ea1/providers/src/airflow/providers/common/sql/hooks/sql.py#L315),
 do not change isolation level. so we changed get_pandas_df to 
`pandas.read_sql` with connection adjusting changed isolation level

I want to keep using get_pandas_df, and changed isolation level when use it! is 
there best, safe way to change isolation level in MySqlHook?

GitHub link: https://github.com/apache/airflow/discussions/43929

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to