You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of category_correspondence consists of a series of if-statements checking for membership in lists, but then falls back to a default (None, None) value intended for when the alternate subcategory is Beliefs or Practices:
# Accounts for AlternateSubcategory.PRACTICES and AlternateSubcategory.BELIEFSreturn (None, None)
But if an alternate subcategory not covered by the if-statements is passed, it will also return (None, None), which is potentially undesired behavior as it conflates an unmapped value with the expected output of beliefs or practices.
I would suggest changing this so it raises an error if an alternate subcategory isn't explicitly mapped to a category or subcategory.
iftyped_alt_subcatin [
AlternateSubcategory.PRACTICES,
AlternateSubcategory.BELIEFS
]:
return (None, None)
# Alternate subcategory passed in isn't mapped to a category/subcategoryraiseValueError(f"Unmapped alternate subcategory: {typed_alt_subcat}")
Activity