1313
1414
1515@dataclass (kw_only = True , frozen = True )
16- class IssueDataWithComment :
16+ class IssueData :
1717 repository_name : str = ''
1818 number : int = 0
1919 title : str = ''
@@ -187,7 +187,7 @@ def get_info(obj, attr):
187187 ):
188188 continue
189189
190- issue_data = IssueDataWithComment (
190+ issue_data = IssueData (
191191 repository_name = repository .name ,
192192 number = issue ._id ,
193193 title = issue .title ,
@@ -216,16 +216,20 @@ def get_info(obj, attr):
216216 sleep (TIMEDELTA )
217217
218218
219- def log_issue_and_comments (csv_name , issue_data : IssueDataWithComment , comments ):
219+ def log_issue_and_comments (csv_name , issue_data : IssueData , comments ):
220220 if comments :
221221 for comment in comments :
222- comment_data = IssueDataWithComment (
223- ** asdict (issue_data ),
224- comment_body = comment .body ,
225- comment_created_at = str (comment .created_at ),
226- comment_author_name = comment .author .username ,
227- comment_author_login = comment .author .login ,
228- comment_author_email = comment .author .email ,
222+ comment_data = IssueData (
223+ ** (
224+ asdict (issue_data ) |
225+ dict (
226+ comment_body = comment .body ,
227+ comment_created_at = str (comment .created_at ),
228+ comment_author_name = comment .author .username ,
229+ comment_author_login = comment .author .login ,
230+ comment_author_email = comment .author .email ,
231+ )
232+ )
229233 )
230234 comment_data = asdict (comment_data )
231235
@@ -244,7 +248,7 @@ def log_issues(
244248 finish : datetime ,
245249 fork_flag : bool ,
246250):
247- info = asdict (IssueDataWithComment ())
251+ info = asdict (IssueData ())
248252 logger .log_to_csv (csv_name , list (info .keys ()))
249253
250254 for client , repo , token in binded_repos :
0 commit comments