def issue_response_time(self, repoid):
"""
How long it takes for issues to be responded to by people who have commits associate with the project
:param repoid: The id of the project in the projects table.
:return: DataFrame with the issues' id the date it was
opened, and the date it was first responded to
"""
issuesSQL = s.sql.text("""
SELECT issues.created_at AS "created_at",
MIN(issue_comments.created_at) AS "responded_at"
FROM issues
JOIN issue_comments
ON issue_comments.issue_id = issues.id
WHERE issue_comments.user_id IN
(SELECT users.id
FROM users
JOIN commits
WHERE commits.author_id = users.id
AND commits.project_id = :repoid)
AND issues.repo_id = :repoid
GROUP BY issues.id
""")
return pd.read_sql(issuesSQL, self.db, params={"repoid": str(repoid)})
评论列表
文章目录