You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/01/14 03:51:50 UTC
[GitHub] [spark] HyukjinKwon commented on a change in pull request #35205: [SPARK-37905][INFRA] Make `merge_spark_pr.py` set primary author from the first commit in case of ties
HyukjinKwon commented on a change in pull request #35205:
URL: https://github.com/apache/spark/pull/35205#discussion_r784490412
##########
File path: dev/merge_spark_pr.py
##########
@@ -135,11 +135,12 @@ def merge_pr(pr_num, target_ref, title, body, pr_repo_desc):
continue_maybe(msg)
had_conflicts = True
+ # First commit author should be considered as the primary author when the rank is the same
commit_authors = run_cmd(
- ["git", "log", "HEAD..%s" % pr_branch_name, "--pretty=format:%an <%ae>"]
+ ["git", "log", "HEAD..%s" % pr_branch_name, "--pretty=format:%an <%ae>", "--reverse"]
).split("\n")
distinct_authors = sorted(
- set(commit_authors), key=lambda x: commit_authors.count(x), reverse=True
+ list(dict.fromkeys(commit_authors)), key=lambda x: commit_authors.count(x), reverse=True
Review comment:
Actually the sort is with `key=lambda x: commit_authors.count(x)`. For the same elements, I think it keeps its natural order. IIRC `sorted` in Python is Timesort that is a stable sort that keeps the same order of same keys
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org