pankajkoti commented on code in PR #31539:
URL: https://github.com/apache/airflow/pull/31539#discussion_r1205250380


##########
airflow/cli/commands/user_command.py:
##########
@@ -112,6 +112,8 @@ def users_delete(args):
     """Deletes user from DB."""
     user = _find_user(args)
 
+    user.roles = []  # Clear foreign keys on this user first.

Review Comment:
   ```suggestion
       user.roles.clear()
   ```
   
   Do you think using `clear` could be better? It would use the existing 
reference to the object to clear the list and show our intent directly rather 
than creating a new empty list and assigning it. We won't need the additional 
comment in that case. What are your thoughts?
   
   I don't have a strong opinion though :)



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