raulcd commented on code in PR #33615: URL: https://github.com/apache/arrow/pull/33615#discussion_r1071113283
########## dev/archery/archery/release/core.py: ########## @@ -74,68 +90,122 @@ def from_jira(cls, jira_issue): summary=jira_issue.fields.summary ) + @classmethod + def from_github(cls, github_issue): + original_jira = cls.original_jira_id(github_issue) + key = original_jira or github_issue.number + return cls( + key=key, + type=next( + iter( + [ + label.name for label in github_issue.labels + if label.name.startswith("Type:") + ] + ), None), + summary=github_issue.title, + github_issue=github_issue + ) + @property def project(self): + if isinstance(self.key, int): + return 'GH' return self.key.split('-')[0] @property def number(self): - return int(self.key.split('-')[1]) + if isinstance(self.key, str): + return int(self.key.split('-')[1]) + else: + return self.key + + @cached_property + def pr(self): + if self.is_pr: + return self._github_issue.as_pull_request() + + @cached_property + def is_pr(self): + return bool(self._github_issue and self._github_issue.pull_request) Review Comment: I do prefer to keep the `github_issue` cached on our `Issue` when available (not for PARQUET) so if we need other things in the future like, components, the PR associated, the sha commit of the merge, etcetera we already have that available. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org