o-nikolas commented on code in PR #47691:
URL: https://github.com/apache/airflow/pull/47691#discussion_r1996315775


##########
airflow/cli/cli_parser.py:
##########
@@ -55,47 +55,52 @@
         CLICommand,
     )
 
-airflow_commands = core_commands.copy()  # make a copy to prevent bad 
interactions in tests
-
-log = logging.getLogger(__name__)
 
+def get_commands():

Review Comment:
   This means that the cli config is not longer loaded/computed once. Since it 
used to be at the module level it was only ever created on the first load of 
this module and then cached for each future import. It's kind of an expensive 
operation too, so it's nice to only do once.
   
   I assume you were hitting some issue with that being cached at the module 
level? In tests probably. This is why you see `reload` littered all over the 
cli tests, to refresh this module.
   
   I think it's okay if we move to runtime, but just be wary that's a pretty 
significant change to bundle along with the original intent of this PR! And we 
should drop all the reloads in tests if we keep this runtime version too.,



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