Repository: Avaiga/taipy
File: taipy/gui_core/_adapters.py (Python)

Code before:
            for f in data:
                if f == "*":
                    flist.extend(self.get_default_list())
                else:
                    flist.append(f)
            if _GuiCoreScenarioProperties.__ENUMS is None and self.full_desc():
                _GuiCoreScenarioProperties.__ENUMS = {
                    "Config id": [c for c in Config.scenarios.keys() if c != "default"],
                    "Tags": [t for s in Config.scenarios.values() for t in s.properties.get("authorized_tags", [])],
                }
            return json.dumps(
                [
                    (attr, _GuiCoreScenarioProperties.get_type(attr), _GuiCoreScenarioProperties.__ENUMS.get(attr))
                    if self.full_desc()
                    else (attr,)
                    for attr in flist
                    if attr and isinstance(attr, str)
                ]
            )
        return None


class _GuiCoreScenarioFilter(_GuiCoreScenarioProperties):
    DEFAULT = list(_GuiCoreScenarioProperties._SC_TYPES.keys())
    DEFAULT_NO_CYCLE = [
        p[0] for p in filter(lambda prop: not prop[1].get("cycle", False), _GuiCoreScenarioProperties._SC_TYPES.items())
    ]

    @staticmethod
    def full_desc():
        return True

    @staticmethod
    def get_hash():
        return _TaipyBase._HOLDER_PREFIX + "ScF"

    @staticmethod
    def get_default_list():
        has_cycle = next(filter(lambda sc: sc.frequency is not None, Config.scenarios.values()), None) is not None
        return _GuiCoreScenarioFilter.DEFAULT if has_cycle else _GuiCoreScenarioFilter.DEFAULT_NO_CYCLE


class _GuiCoreScenarioSort(_GuiCoreScenarioProperties):
    DEFAULT = ["Config id", "Label", "Creation date"]

    @staticmethod
    def full_desc():
        return False

    @staticmethod
    def get_hash():

Review comment (suggestion):
```suggestion
        p[0] for p in filter(lambda prop: not prop[1].get("for_cycle", False), _GuiCoreScenarioProperties._SC_TYPES.items())
```

Code after:
                    flist.append(f)
            if _GuiCoreScenarioProperties.__ENUMS is None and self.full_desc():
                _GuiCoreScenarioProperties.__ENUMS = {
                    "Config id": [c for c in Config.scenarios.keys() if c != "default"],
                    "Tags": list(
                        {t for s in Config.scenarios.values() for t in s.properties.get("authorized_tags", [])}
                    ),
                }
            return json.dumps(
                [
                    (attr, _GuiCoreScenarioProperties.get_type(attr), _GuiCoreScenarioProperties.__ENUMS.get(attr))
                    if self.full_desc()
                    else (attr,)
                    for attr in flist
                    if attr and isinstance(attr, str)
                ]
            )
        return None


class _GuiCoreScenarioFilter(_GuiCoreScenarioProperties):
    DEFAULT = list(_GuiCoreScenarioProperties._SC_PROPS.keys())
    DEFAULT_NO_CYCLE = [
        p[0]
        for p in filter(lambda prop: not prop[1].get("for_cycle", False), _GuiCoreScenarioProperties._SC_PROPS.items())
    ]

    @staticmethod
    def full_desc():
        return True

    @staticmethod
    def get_hash():
        return _TaipyBase._HOLDER_PREFIX + "ScF"

    @staticmethod
    def get_default_list():
        has_cycle = next(filter(lambda sc: sc.frequency is not None, Config.scenarios.values()), None) is not None
        return _GuiCoreScenarioFilter.DEFAULT if has_cycle else _GuiCoreScenarioFilter.DEFAULT_NO_CYCLE


class _GuiCoreScenarioSort(_GuiCoreScenarioProperties):
    DEFAULT = ["Config id", "Label", "Creation date"]

    @staticmethod
    def full_desc():
        return False

    @staticmethod
    def get_hash():
        return _TaipyBase._HOLDER_PREFIX + "ScS"