tirkarthi commented on code in PR #56408:
URL: https://github.com/apache/airflow/pull/56408#discussion_r2418910849


##########
providers/src/airflow/providers/fab/auth_manager/security_manager/override.py:
##########
@@ -19,6 +19,7 @@
 
 import copy
 import datetime
+import importlib

Review Comment:
   `importlib` by itself doesn't have `metadata` attribute and 
`importlib.metadata` is a separate module. Another module import might be a 
side effect adding it to `sys.modules` causing the `importlib.metadata` to be 
valid. `import importlib.metadata` is explicit and better.
   
   ```
   python
   Python 3.11.11 (main, Dec  4 2024, 08:55:08) [GCC 9.4.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import sys, importlib
   >>> importlib.metadata.version("werkzeug")
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   AttributeError: module 'importlib' has no attribute 'metadata'
   >>> "importlib.metadata" in sys.modules
   False
   >>> from airflow import __version__ as airflow_version
   
/home/karthikeyan/stuff/python/airflow/airflow-core/src/airflow/configuration.py:814
 DeprecationWarning: The grid_view_sorting_order option in [webserver] has been 
moved to the grid_view_sorting_order option in [api] - the old setting has been 
used, but please update your config.
   
/home/karthikeyan/stuff/python/airflow/airflow-core/src/airflow/configuration.py:815
 DeprecationWarning: The grid_view_sorting_order option in [webserver] has been 
moved to the grid_view_sorting_order option in [api] - the old setting has been 
used, but please update your config.
   
/home/karthikeyan/stuff/python/airflow/airflow-core/src/airflow/configuration.py:869
 DeprecationWarning: The secret_key option in [webserver] has been moved to the 
secret_key option in [api] - the old setting has been used, but please update 
your config.
   >>> "importlib.metadata" in sys.modules
   True
   >>> importlib.metadata.version("werkzeug")
   '2.2.3'
   ```



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