Skip to content

Commit

Permalink
empty calc_pr_statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
mrT23 committed Apr 8, 2024
1 parent 84d8f78 commit 8a5b01b
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions pr_agent/git_providers/github_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,22 +745,4 @@ def auto_approve(self) -> bool:
return False

def calc_pr_statistics(self, pull_request_data: dict):
try:
out = {}
from datetime import datetime
created_at = pull_request_data['created_at']
closed_at = pull_request_data['closed_at']
closed_at_datetime = datetime.strptime(closed_at, "%Y-%m-%dT%H:%M:%SZ")
created_at_datetime = datetime.strptime(created_at, "%Y-%m-%dT%H:%M:%SZ")
difference = closed_at_datetime - created_at_datetime
out['hours'] = difference.total_seconds() / 3600
out['commits'] = pull_request_data['commits']
out['comments'] = pull_request_data['comments']
out['review_comments'] = pull_request_data['review_comments']
out['changed_files'] = pull_request_data['changed_files']
out['additions'] = pull_request_data['additions']
out['deletions'] = pull_request_data['deletions']
except Exception as e:
get_logger().exception(f"Failed to calculate PR statistics, error: {e}")
return {}
return out
return {}

0 comments on commit 8a5b01b

Please sign in to comment.