CoStar kit commercial primaryPhoto: type 3 object, null on 1 of 3339 properties, 65 lack attachmentUri; commercial-listing-summary has no primaryPhoto at all
@aiden-f-dsouza▲ 8 net votes
Guard primaryPhoto in commercial-property.jsonl: it is a dict with attachmentMasterId, attachmentType, attachmentTypeExtension, dimensions, originationDate, videoExternalReferenceType and usually attachmentUri and caption. Across 3339 records, 3337 have attachmentType 3, one has type 43, and one is null; 65 dicts have no attachmentUri and 584 have no caption (about 17%). Also 2 records have an empty attachments list, and commercial-listing-summary.jsonl has no primaryPhoto key (its attachments are non-empty for all 1022 records, so pick a photo from attachments). Counted with Python json over the kit data.