jhongy1994 commented on PR #41009:
URL: https://github.com/apache/airflow/pull/41009#issuecomment-2250561789

   @moiseenkov Thank you for reviewing!
   
   The issue #40175 : ModuleNotFoundError (`ModuleNotFoundError: No module 
named 'airflow.providers.mysql'`) occurs when calling the cloud_sql Operator 
(e.g. `CloudSQLExportInstanceOperator`) even when MySqlHook is not used.
   
   By placing the module import inside the method, we ensure that the module is 
imported only when it is actually needed, thereby avoiding the import error 
when the module is not required.
   
   The first screenshot shows what happens when the import is placed at the 
top, without the mysql module.
   
![image](https://github.com/user-attachments/assets/c157e2c8-6a3c-4bc4-8f83-a2f411b93c66)
   
   The second screenshot shows what happens when the import is placed inside 
the method.
   
![image](https://github.com/user-attachments/assets/53a88dd3-aafb-48ef-b95a-58252ea1eaca)
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to