File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,9 @@ def import_metadata(schema: str, metadata: str) -> dict:
334
334
:returns: MCF object
335
335
"""
336
336
337
+ content = None
338
+ error_message = None
339
+
337
340
if schema == 'autodetect' :
338
341
schemas = get_supported_schemas ()
339
342
else :
@@ -344,11 +347,17 @@ def import_metadata(schema: str, metadata: str) -> dict:
344
347
schema_object = load_schema (s )
345
348
346
349
try :
347
- return schema_object .import_ (metadata )
350
+ content = schema_object .import_ (metadata )
351
+ break
348
352
except NotImplementedError :
349
- raise RuntimeError ( f'Import not supported for { s } ' )
353
+ error_message = f'Import not supported for { s } '
350
354
except Exception as err :
351
- raise RuntimeError (f'Import failed: { err } ' )
355
+ error_message = f'Import failed: { err } '
356
+
357
+ if error_message is not None :
358
+ LOGGER .warning (error_message )
359
+
360
+ return content
352
361
353
362
354
363
def transform_metadata (input_schema : str , output_schema : str ,
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ def test_get_supported_schemas(self):
236
236
'Expected exact list of supported schemas' )
237
237
238
238
schemas = get_supported_schemas (include_autodetect = True )
239
- self .assertEqual (len (schemas ), 10 ,
239
+ self .assertEqual (len (schemas ), 11 ,
240
240
'Expected specific number of supported schemas' )
241
241
self .assertIn ('autodetect' , schemas , 'Expected autodetect in list' )
242
242
You can’t perform that action at this time.
0 commit comments