Repository: Avaiga/taipy
File: taipy/common/config/config.py (Python)

Code before:
                cls._default_config._unique_sections[default_section.name] = default_section
        elif def_sections := cls._default_config._sections.get(default_section.name, None):
            def_sections[default_section.id] = default_section
        else:
            cls._default_config._sections[default_section.name] = {default_section.id: default_section}
        cls._serializer._section_class[default_section.name] = default_section.__class__  # type: ignore
        cls.__json_serializer._section_class[default_section.name] = default_section.__class__  # type: ignore
        cls._compile_configs()

    @classmethod
    @_ConfigBlocker._check()
    def _register(cls, section) -> None:
        if isinstance(section, UniqueSection):
            if cls._python_config._unique_sections.get(section.name, None):
                cls._python_config._unique_sections[section.name]._update(section._to_dict())
            else:
                cls._python_config._unique_sections[section.name] = section
        elif sections := cls._python_config._sections.get(section.name, None):
            if sections.get(section.id, None):
                sections[section.id]._update(section._to_dict())
            else:
                sections[section.id] = section
        else:
            cls._python_config._sections[section.name] = {section.id: section}
            cls._serializer._section_class[section.name] = section.__class__
            cls.__json_serializer._section_class[section.name] = section.__class__
        cls._compile_configs()

    @classmethod
    def _override_env_file(cls) -> None:
        if cfg_filename := os.environ.get(cls._ENVIRONMENT_VARIABLE_NAME_WITH_CONFIG_PATH):
            if not os.path.exists(cfg_filename):
                cls.__logger.error(
                    f"File '{cfg_filename}' provided by environment variable "
                    f"'{cls._ENVIRONMENT_VARIABLE_NAME_WITH_CONFIG_PATH}' does not exist. "
                    f"No configuration will be loaded from environment variable."
                )
                return
            cls.__logger.info(f"Loading configuration provided by environment variable. Filename: '{cfg_filename}'")
            cls._env_file_config = cls._serializer._read(cfg_filename)
            cls.__logger.info(f"Configuration '{cfg_filename}' successfully loaded.")

    @classmethod
    def _compile_configs(cls) -> None:
        Config._override_env_file()
        cls._applied_config._clean()
        if cls._default_config:
            cls._applied_config._update(cls._default_config)
        if cls._python_config:
            cls._applied_config._update(cls._python_config)
        if cls._file_config:

Review comment (suggestion):
```suggestion
        cls._serializer._section_class[section.name] = section.__class__
        cls.__json_serializer._section_class[section.name] = section.__class__
```

Code after:
                cls._default_config._unique_sections[default_section.name] = default_section
        elif def_sections := cls._default_config._sections.get(default_section.name, None):
            def_sections[default_section.id] = default_section
        else:
            cls._default_config._sections[default_section.name] = {default_section.id: default_section}
        cls._serializer._section_class[default_section.name] = default_section.__class__  # type: ignore
        cls.__json_serializer._section_class[default_section.name] = default_section.__class__  # type: ignore
        cls._compile_configs()

    @classmethod
    @_ConfigBlocker._check()
    def _register(cls, section) -> None:
        if isinstance(section, UniqueSection):
            if cls._python_config._unique_sections.get(section.name, None):
                cls._python_config._unique_sections[section.name]._update(section._to_dict())
            else:
                cls._python_config._unique_sections[section.name] = section
        elif sections := cls._python_config._sections.get(section.name, None):
            if sections.get(section.id, None):
                sections[section.id]._update(section._to_dict())
            else:
                sections[section.id] = section
        else:
            cls._python_config._sections[section.name] = {section.id: section}
        cls._serializer._section_class[section.name] = section.__class__
        cls.__json_serializer._section_class[section.name] = section.__class__
        cls._compile_configs()

    @classmethod
    def _override_env_file(cls) -> None:
        if cfg_filename := os.environ.get(cls._ENVIRONMENT_VARIABLE_NAME_WITH_CONFIG_PATH):
            if not os.path.exists(cfg_filename):
                cls.__logger.error(
                    f"File '{cfg_filename}' provided by environment variable "
                    f"'{cls._ENVIRONMENT_VARIABLE_NAME_WITH_CONFIG_PATH}' does not exist. "
                    f"No configuration will be loaded from environment variable."
                )
                return
            cls.__logger.info(f"Loading configuration provided by environment variable. Filename: '{cfg_filename}'")
            cls._env_file_config = cls._serializer._read(cfg_filename)
            cls.__logger.info(f"Configuration '{cfg_filename}' successfully loaded.")

    @classmethod
    def _compile_configs(cls) -> None:
        Config._override_env_file()
        cls._applied_config._clean()
        if cls._default_config:
            cls._applied_config._update(cls._default_config)
        if cls._python_config:
            cls._applied_config._update(cls._python_config)
        if cls._file_config: