Skip to content

Commit

Permalink
projects: use session_projects and switch slug to primarySlug (…
Browse files Browse the repository at this point in the history
…Bug 1919859)
  • Loading branch information
cgsheeh committed Oct 28, 2024
1 parent c91393b commit 3b1e7c1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ def get_revision_projects(
# Get the PHID of each project (the destination on the edge).
project_phids = {edge.dst for edge in edge_query_result}

# Get the project objects for the set of PHIDs.
projects = projects_query.filter(ProjectDb.Project.phid.in_(project_phids)).all()

# Convert the project PHID to the slug (name).
return [
project.slug
for project in projects_query.filter(
ProjectDb.Project.phid.in_(project_phids)
).all()
]
return [project.primarySlug for project in projects]


def get_stack_size(
Expand Down Expand Up @@ -473,7 +471,7 @@ def process():
updated_revisions = session_diff.query(DiffDb.Revision).filter(*time_queries)
all_revisions = session_diff.query(DiffDb.Revision)

projects_query = session_diff.query(ProjectDb.Project)
projects_query = session_projects.query(ProjectDb.Project)

bug_id_query = session_diff.query(DiffDb.CustomFieldStorage).filter(
# TODO I got this value from the DB, what is it?
Expand Down

0 comments on commit 3b1e7c1

Please sign in to comment.