saidiraja commented on issue #65652:
URL: https://github.com/apache/airflow/issues/65652#issuecomment-4347304784

   I was able to reproduce this issue on my local environment.
   
   ## Environment
   
   * Apache Airflow: 3.2.0
   * Python: 3.12.3
   * OS: Ubuntu (WSL2)
   * Installation: local virtualenv
   
   ## Steps to reproduce
   
   Run:
   
   ```bash
   python -c 'import airflow.utils.db; print("IMPORTED airflow.utils.db")'
   ```
   
   ## Observed behavior
   
   The following Alembic plugin setup logs are printed during import:
   
   ```text
   setup plugin alembic.autogenerate.schemas
   setup plugin alembic.autogenerate.tables
   setup plugin alembic.autogenerate.types
   setup plugin alembic.autogenerate.constraints
   setup plugin alembic.autogenerate.defaults
   setup plugin alembic.autogenerate.comments
   IMPORTED airflow.utils.db
   ```
   
   ## Control test
   
   Running:
   
   ```bash
   python -c 'import airflow; print("IMPORTED airflow")'
   ```
   
   Produces:
   
   ```text
   IMPORTED airflow
   ```
   
   (no Alembic logs)
   
   ## Additional confirmation
   
   Running:
   
   ```bash
   python -c 'import airflow.utils.db_manager; print("IMPORTED 
airflow.utils.db_manager")'
   ```
   
   produces the same Alembic plugin setup logs.
   
   ## Conclusion
   
   The issue is reproducible.
   The Alembic plugin initialization appears to be triggered during module 
import (`airflow.utils.db` / `db_manager`), rather than being deferred to 
migration-related operations.
   
   ## Attachments
   
   Screenshots and logs demonstrating the reproduction are included.
   
   <img width="952" height="403" alt="Image" 
src="https://github.com/user-attachments/assets/ac52e352-ff46-4e51-90ab-373da8f60daa";
 />
   <img width="948" height="127" alt="Image" 
src="https://github.com/user-attachments/assets/930046a4-6e48-4859-be22-6c65054771d7";
 />
   
   <img width="957" height="447" alt="Image" 
src="https://github.com/user-attachments/assets/4f15acdc-243d-4562-b7f1-4bfe7d2f68ce";
 />
   
   <img width="691" height="205" alt="Image" 
src="https://github.com/user-attachments/assets/782804b9-03ed-4f6d-b638-4e6bed3800e5";
 />


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