def get_subset_def_data_for_eval_key(self, ctx, scenario):
        """
        Builds and returns an execution cache key for each type of scenario.
        """
        view_state = ctx.panel.get_state("view") or {}
        eval_key = view_state.get("key")
        computed_eval_key = ctx.params.get("key", eval_key)

        scenario_type = scenario.get("type", "")
        scenario_field = scenario.get("field", "")
        scenario_subsets = scenario.get("subsets", "")

        if scenario_type in ["label_attribute", "sample_field"]:
            return [
                "subset-data",
                computed_eval_key,
                scenario_type,
                scenario_field,
                scenario_subsets,
            ]

        return [
            "subset-data",
            computed_eval_key,
            scenario_type,
            scenario_subsets,
        ]

        Builds and returns an execution cache key for each type of scenario.
        
plugins/panels/model_evaluation/__init__.py