You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "SamWheating (via GitHub)" <gi...@apache.org> on 2023/08/22 22:16:20 UTC
[GitHub] [airflow] SamWheating commented on a diff in pull request #33631: Refactor: Use random.choices
SamWheating commented on code in PR #33631:
URL: https://github.com/apache/airflow/pull/33631#discussion_r1302246497
##########
airflow/cli/commands/standalone_command.py:
##########
@@ -193,9 +193,7 @@ def initialize_database(self):
self.print_output("standalone", "Creating admin user")
role = appbuilder.sm.find_role("Admin")
assert role is not None
- password = "".join(
- random.choice("abcdefghkmnpqrstuvwxyzABCDEFGHKMNPQRSTUVWXYZ23456789") for i in range(16)
- )
+ password = "".join(random.choices("abcdefghkmnpqrstuvwxyzABCDEFGHKMNPQRSTUVWXYZ23456789", k=16))
Review Comment:
Can we just replace this with `string.ascii_letters + string.digits` while we're in here?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org