Skip to content

Commit

Permalink
Revert "Map old category names to new names (#44)" (#47)
Browse files Browse the repository at this point in the history
This reverts commit 5f00a7d.
  • Loading branch information
diversemix authored Apr 20, 2023
1 parent 6810031 commit 8e81ee8
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions cli/index_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@
logging.config.dictConfig(DEFAULT_LOGGING)


def _map_old_category_to_new(supplied_category: str) -> str:
"""Map old category names to new category names, or return existing string"""
if supplied_category.lower() == "law":
return "Legislative"
if supplied_category.lower() == "policy":
return "Executive"
return supplied_category


def get_metadata_dict(task: IndexerInput) -> dict:
"""
Get key-value pairs for metadata fields: fields which are not required for search.
Expand All @@ -60,8 +51,6 @@ def get_metadata_dict(task: IndexerInput) -> dict:
**{k: v for k, v in task.dict().items() if k != "document_metadata"},
**{f"document_{k}": v for k, v in task.document_metadata.dict().items()},
}
supplied_category = task_dict["document_category"]
task_dict["document_category"] = _map_old_category_to_new(supplied_category)
task_dict["document_name_and_slug"] = f"{task.document_name} {task.document_slug}"
required_fields = [field for fields in COMMON_FIELDS.values() for field in fields]

Expand Down

0 comments on commit 8e81ee8

Please # to comment.