amol- commented on code in PR #13427:
URL: https://github.com/apache/arrow/pull/13427#discussion_r907350646
##########
dev/merge_arrow_pr.py:
##########
@@ -139,16 +139,24 @@ def __init__(self, jira_con, jira_id, project, cmd):
def current_fix_versions(self):
return self.issue.fields.fixVersions
+ @classmethod
+ def sort_versions(cls, versions):
+ def version_tuple(x):
+ version = x.name
+ # Parquet versions are something like cpp-1.2.0
+ if "-" in version:
+ version = version.split("-")[1]
Review Comment:
I think we can avoid the `if` and be more robust to a variable amount of `-`
if we split with a limit:
```
>>> "cpp-3.1.3".split("-", 1)[-1]
'3.1.3'
>>> "3.1.3".split("-", 1)[-1]
'3.1.3'
```
Would also be more robust with something like `cpp-9-more` where
```
>>> "cpp-9-more".split("-")[1]
'9'
```
would end up being parsed as version 9 (which is an "undefined behaviour")
Instead
```
>>> "cpp-9-more".split("-", 1)[-1]
'9-more'
```
would properly crash telling you that `9-more` is not a valid version number
which makes the behaviour more predictable.
--
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]