joaopamaral commented on code in PR #40703:
URL: https://github.com/apache/airflow/pull/40703#discussion_r1675790023


##########
airflow/models/dag.py:
##########
@@ -906,21 +908,33 @@ def 
_upgrade_outdated_dag_access_control(access_control=None):
         """
         if access_control is None:
             return None
-        new_perm_mapping = {
+        new_dag_perm_mapping = {
             permissions.DEPRECATED_ACTION_CAN_DAG_READ: 
permissions.ACTION_CAN_READ,
             permissions.DEPRECATED_ACTION_CAN_DAG_EDIT: 
permissions.ACTION_CAN_EDIT,
         }
+
+        def update_old_perm(permission: str):
+            new_perm = new_dag_perm_mapping.get(permission, permission)
+            if new_perm != permission:
+                warnings.warn(
+                    f"The '{permission}' permission is deprecated. Please use 
'{new_perm}'.",
+                    RemovedInAirflow3Warning,
+                    stacklevel=3,
+                )

Review Comment:
   There is already a test, but I've added some assert to get the warning count 
and check if is a `permission is deprecated` warning (now there will be one for 
each permission).
   
https://github.com/apache/airflow/pull/40703/commits/76867255fbeac65d629ba32d05b1186cc925c71d
   



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