def METHOD_NAME(self, attribute, value):
    if len(value) > MAXIMUM_UPGRADES:
        # If you hit this case, congratulations on your epic schema.  Your
        # prize is that you get to implement some kind of schema
        # consolidation mechanism.
        raise ValueError(
            "Schema has {} upgrades, greater than maximum allowed {}".format(
                len(value),
                MAXIMUM_UPGRADES,
            ),
        )