dongjoon-hyun commented on a change in pull request #35205:
URL: https://github.com/apache/spark/pull/35205#discussion_r784490728
##########
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:
Yes, please see the following, @gengliangwang .
```python
>>> commit_authors=['a', 'b', 'c']
>>> sorted(set(commit_authors), key=lambda x: commit_authors.count(x),
reverse=True)
['c', 'a', 'b']
>>> sorted(list(dict.fromkeys(commit_authors)), key=lambda x:
commit_authors.count(x), reverse=True)
['a', 'b', 'c']
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]