Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assignment negative fix #714

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -372,5 +372,10 @@ def pr_assignment(df, start_date, end_date, contrib):
(df_in_range["assignment_action"] == "assigned") & (df_in_range["assign_date"] <= end_date)
]

# return the different of assignments and unassignments
return df_assigned.shape[0] - df_unassign.shape[0]
# the different of assignments and unassignments
assign_value = df_assigned.shape[0] - df_unassign.shape[0]

# prevent negative assignments
assign_value = 0 if assign_value < 0 else assign_value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can this be negative in the given range?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ill be honest its been a while since I implemented this/ I dont think I fully knew at the time either. I think it is if there are assignments before the github apis start point for really large repos (like rust in the example) and then they are unassignments of those it ends up negative

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, at minimum this clip the value which is feature-correct lol


return assign_value
Original file line number Diff line number Diff line change
Expand Up @@ -369,5 +369,10 @@ def issue_assignment(df, start_date, end_date, contrib):
(df_in_range["assignment_action"] == "assigned") & (df_in_range["assign_date"] <= end_date)
]

# return the different of assignments and unassignments
return df_assigned.shape[0] - df_unassign.shape[0]
# the different of assignments and unassignments
assign_value = df_assigned.shape[0] - df_unassign.shape[0]

# prevent negative assignments
assign_value = 0 if assign_value < 0 else assign_value

return assign_value
Loading