@@ -93,7 +93,8 @@ def get_copilot_team_date(gh: github_api_toolkit.github_interface, page: int) ->
9393 team_html_url = team .get ("html_url" , "" )
9494
9595 logger .info (
96- f"Team { team_name } has Copilot data" ,
96+ "Team % has Copilot data" ,
97+ team_name ,
9798 extra = {
9899 "team_name" : team_name ,
99100 "team_slug" : team_slug ,
@@ -338,7 +339,7 @@ def get_dict_value(dictionary: dict, key: str) -> Any:
338339 value = dictionary .get (key )
339340
340341 if value is None :
341- raise Exception (f"Key { key } not found in the dictionary." )
342+ raise ValueError (f"Key { key } not found in the dictionary." )
342343
343344 return value
344345
@@ -356,22 +357,22 @@ def get_config_file(path: str) -> Any:
356357 Any: The configuration file as a dictionary.
357358 """
358359 try :
359- with open (path ) as f :
360+ with open (path , encoding = "utf-8" ) as f :
360361 config = json .load (f )
361362 except FileNotFoundError :
362363 error_message = f"{ path } configuration file not found. Please check the path."
363- raise Exception (error_message ) from None
364+ raise FileNotFoundError (error_message ) from None
364365
365- if type (config ) is not dict :
366+ if not isinstance (config , dict ) :
366367 error_message = (
367368 f"{ path } configuration file is not a dictionary. Please check the file contents."
368369 )
369- raise Exception (error_message )
370+ raise TypeError (error_message )
370371
371372 return config
372373
373374
374- def handler (event : dict , context ) -> str : # pylint: disable=unused-argument
375+ def handler (event : dict , context ) -> str : # pylint: disable=unused-argument, too-many-locals
375376 """AWS Lambda handler function for GitHub Copilot usage data aggregation.
376377
377378 This function:
0 commit comments