diff --git a/label_studio/io_storages/base_models.py b/label_studio/io_storages/base_models.py index 5c6adc329325..e2528fd9679f 100644 --- a/label_studio/io_storages/base_models.py +++ b/label_studio/io_storages/base_models.py @@ -420,25 +420,27 @@ def _scan_and_create_links(self, link_class): # w/o Dataflow # pubsub.push(topic, key) # -> GF.pull(topic, key) + env -> add_task() - logger.debug(f'Scanning key {key}') + logger.debug('Scanning key %s', key) self.info_update_progress(last_sync_count=tasks_created, tasks_existed=tasks_existed) # skip if key has already been synced if n_tasks_linked := link_class.n_tasks_linked(key, self): - logger.debug(f'{self.__class__.__name__} already has {n_tasks_linked} tasks linked to {key=}') + logger.debug('%s link %s already exists with %d tasks linked', self.__class__.__name__, key, n_tasks_linked) tasks_existed += n_tasks_linked # update progress counter continue - logger.debug(f'{self}: found new key {key}') + logger.debug('%s: found new key %s', self.__class__.__name__, key) try: tasks_data = self.get_data(key) except (UnicodeDecodeError, json.decoder.JSONDecodeError) as exc: logger.debug(exc, exc_info=True) - raise ValueError( - f'Error loading JSON from file "{key}".\nIf you\'re trying to import non-JSON data ' - f'(images, audio, text, etc.), edit storage settings and enable ' - f'"Treat every bucket object as a source file"' + logger.warning( + 'Error loading JSON from file %s: %s. If you\'re trying to import non-JSON data ' + '(images, audio, text, etc.), edit storage settings and enable ' + '"Treat every bucket object as a source file"', + key, exc ) + continue if isinstance(tasks_data, dict): tasks_data = [tasks_data]