def spec_key_comparator(key_a: str, key_b: str) -> int:
    """
    Comparator to sort spec keys putting the '*' key last.
    """
    if key_a == '*':
        return 1
    elif key_b == '*':
        return -1
    return key_a.__lt__(key_b)