from utils.exceptions import UnprocessableEntity class InvalidBreakdownOption(UnprocessableEntity): code = "invalid_breakdown_option" detail = "Selected segment type is not valid for given performance metrics" class InvalidMetricsDatePeriod(UnprocessableEntity): code = "invalid_date_range" detail = "Selected date range is not valid with current breakdown type" extra = {} def __init__(self, max_period: str): self.extra = {"max_period": max_period}