diff --git a/devstats/reports/issue_time_to_response.md b/devstats/reports/issue_time_to_response.md index 7e06fb0..909cd11 100644 --- a/devstats/reports/issue_time_to_response.md +++ b/devstats/reports/issue_time_to_response.md @@ -7,8 +7,8 @@ tags: [hide-input] # Remove issues that are less than a day old for the following analysis newly_created_day_old = [ iss for iss in newly_created - if np.datetime64(datetime.datetime.now()) - np.datetime64(iss["createdAt"]) - > np.timedelta64(1, "D") + if (np.datetime64(datetime.datetime.now()) + - np.datetime64(iss["createdAt"].rstrip("Z"))) > np.timedelta64(1, "D") ] # TODO: really need pandas here @@ -28,7 +28,8 @@ for iss in commented_issues: # This can happen e.g. when a user deletes their GH acct user = "UNKNOWN" first_commenters.append(user) - dt = np.datetime64(e["node"]["createdAt"]) - np.datetime64(iss["createdAt"]) + dt = (np.datetime64(e["node"]["createdAt"]).rstrip("Z") + - np.datetime64(iss["createdAt"]).rstrip("Z")) time_to_first_comment.append(dt.astype("m8[m]")) break # Only want the first commenter time_to_first_comment = np.array(time_to_first_comment) # in minutes diff --git a/devstats/reports/new_issues.md b/devstats/reports/new_issues.md index a825908..cb78e35 100644 --- a/devstats/reports/new_issues.md +++ b/devstats/reports/new_issues.md @@ -8,13 +8,14 @@ tags: [hide-input] --- newly_created = [ - iss for iss in issues if np.datetime64(iss["createdAt"]) > query_date + iss for iss in issues if np.datetime64(iss["createdAt"].rstrip("Z")) > query_date ] new_issues_closed = [iss for iss in newly_created if iss["state"] == "CLOSED"] new_issue_lifetime = np.array( [ - np.datetime64(iss["closedAt"]) - np.datetime64(iss["createdAt"]) + (np.datetime64(iss["closedAt"].rstrip("Z")) + - np.datetime64(iss["createdAt"].rstrip("Z"))) for iss in new_issues_closed ], ).astype("m8[h]") # in hours