jorisvandenbossche commented on a change in pull request #11978:
URL: https://github.com/apache/arrow/pull/11978#discussion_r781982186
##########
File path: dev/archery/archery/crossbow/core.py
##########
@@ -537,17 +537,36 @@ def _latest_prefix_id(self, prefix):
latest = -1
return latest
+ def _latest_prefix_date(self, prefix):
+ pattern = re.compile(r'[\w\/-]*{}-(\d+)-(\d+)-(\d+)'.format(prefix))
+ matches = list(filter(None, map(pattern.match, self.repo.branches)))
+ if matches:
+ latest = sorted([m.group(0) for m in matches])[-1]
+ # slice the trailing date part (YYYY-MM-DD)
+ latest = latest[-10:]
+ else:
+ latest = -1
+ return latest
Review comment:
That's just too long to fit on a single line unfortunately, so then it
might not actually get that much more readable if the one-liner uses line
continuation .. So will leave as is.
--
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]