potiuk commented on code in PR #24591:
URL: https://github.com/apache/airflow/pull/24591#discussion_r906717837


##########
airflow/cli/__main__.py:
##########
@@ -18,6 +18,7 @@
 # under the License.
 
 from airflow.cli import airflow_cmd
+from airflow.cli.commands import version  # noqa: F401

Review Comment:
   Agree with @uranusjr. Until we have https://peps.python.org/pep-0690/ 
implemented (which if we are lucky gets into python 3.12 IMHO) - comment from 
`breeze' experience - we have implemented a check to make sure that only 
minimum set of imorts is actually done while the @click decorators are being 
parsed.
   
   This means (and in Breeze we are following it) that most of the imports used 
in "command" are local imports. But we do not only have to implement it now, 
but also make sure it will be kept in the future, otherwise anyone committing 
changes to commands in the future will not fall into a "trap" of adding 
top-level import and influencing auto-complete to take even several hundred 
milliseconds - which will make it barely usable.
   
   We have a pre-commit for it:
   
   https://github.com/apache/airflow/blob/main/.pre-commit-config.yaml#L638
   
   And I guess similar pre-commit should be run for all @click commands 



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