librarian-bot commited on
Commit
e84d398
1 Parent(s): 0b71383

rename load_repo_card function

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -98,7 +98,7 @@ def parse_webhook_post(data: Dict[str, Any]) -> Optional[Tuple[str, str]]:
98
  return repo_type, repo_name
99
 
100
 
101
- def load_repo_card(repo_type, repo_name):
102
  if repo_type == "dataset":
103
  try:
104
  return DatasetCard.load(repo_name).data.to_dict()
@@ -116,7 +116,7 @@ def create_or_update_report(data):
116
  repo_type, repo_name = parsed_post
117
  else:
118
  return Response("Unable to parse webhook data", status_code=400)
119
- card_data = load_repo_card(repo_type, repo_name)
120
  desired_metadata_dictionary = create_metadata_key_dict(card_data, repo_type)
121
  score = calculate_grade(desired_metadata_dictionary)
122
  report = create_markdown_report(
 
98
  return repo_type, repo_name
99
 
100
 
101
+ def load_repo_card_metadata(repo_type, repo_name):
102
  if repo_type == "dataset":
103
  try:
104
  return DatasetCard.load(repo_name).data.to_dict()
 
116
  repo_type, repo_name = parsed_post
117
  else:
118
  return Response("Unable to parse webhook data", status_code=400)
119
+ card_data = load_repo_card_metadata(repo_type, repo_name)
120
  desired_metadata_dictionary = create_metadata_key_dict(card_data, repo_type)
121
  score = calculate_grade(desired_metadata_dictionary)
122
  report = create_markdown_report(