File tree 1 file changed +16
-2
lines changed
data-pipeline/src/pipeline 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,15 @@ def compute_distances(
417
417
distances = pupil_distances [idx ],
418
418
include = include_pupils ,
419
419
)
420
- pupils .loc [urn ] = top_pupil_set_urns
420
+ # note: single-element arrays are unpacked; in this
421
+ # case, do not produce a comparator-set.
422
+ if len (top_pupil_set_urns ) == 1 :
423
+ logger .warning (
424
+ f"Unable to produce pupil comparator-set for URN: { urn } ."
425
+ )
426
+ pupils .loc [urn ] = np .array ([])
427
+ else :
428
+ pupils .loc [urn ] = top_pupil_set_urns
421
429
422
430
if not row ["_GenerateBuildingComparatorSet" ][idx ]:
423
431
buildings .loc [urn ] = np .array ([])
@@ -432,7 +440,13 @@ def compute_distances(
432
440
building_distances [idx ],
433
441
include = include_buildings ,
434
442
)
435
- buildings .loc [urn ] = top_building_set_urns
443
+ if len (top_building_set_urns ) == 1 :
444
+ logger .warning (
445
+ f"Unable to produce building comparator-set for URN: { urn } ."
446
+ )
447
+ buildings .loc [urn ] = np .array ([])
448
+ else :
449
+ buildings .loc [urn ] = top_building_set_urns
436
450
except Exception as error :
437
451
logger .exception (
438
452
f"An exception occurred { type (error ).__name__ } processing { urn } :" ,
You can’t perform that action at this time.
0 commit comments