def _set_config()

in cli/src/klio_cli/commands/job/configuration.py [0:0]


    def _set_config(self, target, value):
        try:
            glom.assign(self.config_data, target, value, missing=dict)
        except glom.mutation.PathAssignError as e:
            if "IndexError" not in str(e):
                raise e
            # handle if user is trying to append to a list - for some reason
            # glom can't handle that
            stems = target.split(".")
            last_index = 0
            for index, stem in enumerate(stems):
                try:
                    int(stem)
                except Exception:
                    continue
                new_target = ".".join(stems[last_index:index])
                property_list = glom.glom(self.config_data, new_target)
                property_list.insert(index, {})

            glom.assign(self.config_data, target, value, missing=dict)