You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2023/09/25 12:51:02 UTC

[GitHub] [airflow] Taragolis commented on pull request #34600: Ban lazy imports from `airflow` and `airflow.models` in codebase

Taragolis commented on PR #34600:
URL: https://github.com/apache/airflow/pull/34600#issuecomment-1733649787

   There are 500+ occurrence lazy imports in airflow codebase, without from `airflow import __version__`
   
   In general every import should be excluded by up to 3 PRs:
   1. Exclude from core + core tests + example dags
   2. Exclude from providers + providers tests
   3. Ban import in `[tool.ruff.flake8-tidy-imports.banned-api]`
   
   What I have done with `airflow.AirflowException` locally:
   1. Create in branch and in first commit was banned in`[tool.ruff.flake8-tidy-imports.banned-api]`
   2. `pre-commit run ruff --all-files`
   3. Resolve all cases in core, create second commit
   4. `pre-commit run ruff --all-files`
   5. Resolve all cases in providers, create third commit(s)
   6. Check again that there is no any static checks failed
   7. Create 3 branches from `main` and cherry pick changes
   8. Create 3 PRs


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org