def committer_locations(self, repoid):
"""
Return committers and their locations
@todo: Group by country code instead of users, needs the new schema
:param repoid: The id of the project in the projects table.
:return: DataFrame with users and locations sorted by commtis
"""
rawContributionsSQL = s.sql.text("""
SELECT users.login, users.location, COUNT(*) AS "commits"
FROM commits
JOIN project_commits
ON commits.id = project_commits.commit_id
JOIN users
ON users.id = commits.author_id
WHERE project_commits.project_id = :repoid
AND LENGTH(users.location) > 1
GROUP BY users.id
ORDER BY commits DESC
""")
return pd.read_sql(rawContributionsSQL, self.db, params={"repoid": str(repoid)})
评论列表
文章目录