Skip to content

Commit b78761c

Browse files
author
nik
committed
fix: BROS-23: Don't fail on parsing errors in storage
1 parent 8e79aa5 commit b78761c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

label_studio/io_storages/base_models.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,25 +420,26 @@ def _scan_and_create_links(self, link_class):
420420
# w/o Dataflow
421421
# pubsub.push(topic, key)
422422
# -> GF.pull(topic, key) + env -> add_task()
423-
logger.debug(f'Scanning key {key}')
423+
logger.debug('Scanning key %s', key)
424424
self.info_update_progress(last_sync_count=tasks_created, tasks_existed=tasks_existed)
425425

426426
# skip if task already exists
427427
if link_class.exists(key, self):
428-
logger.debug(f'{self.__class__.__name__} link {key} already exists')
428+
logger.debug('%s link %s already exists', self.__class__.__name__, key)
429429
tasks_existed += 1 # update progress counter
430430
continue
431431

432-
logger.debug(f'{self}: found new key {key}')
432+
logger.debug('%s: found new key %s', self.__class__.__name__, key)
433433
try:
434434
tasks_data = self.get_data(key)
435435
except (UnicodeDecodeError, json.decoder.JSONDecodeError) as exc:
436436
logger.debug(exc, exc_info=True)
437-
raise ValueError(
437+
logger.warning(
438438
f'Error loading JSON from file "{key}".\nIf you\'re trying to import non-JSON data '
439439
f'(images, audio, text, etc.), edit storage settings and enable '
440440
f'"Treat every bucket object as a source file"'
441441
)
442+
continue
442443

443444
if not flag_set('fflag_feat_dia_2092_multitasks_per_storage_link'):
444445
tasks_data = tasks_data[:1]

0 commit comments

Comments
 (0)