Skip to content

Commit

Permalink
FIX: Drop JSON sidecar fields with null values during metadata indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Aug 16, 2023
1 parent fcaebca commit c732750
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bids/layout/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,10 @@ def create_association_pair(src, dst, kind, kind2=None):

# Create Tag <-> Entity mappings, and any newly discovered Entities
for md_key, md_val in file_md.items():
# Treat null entries (deserialized to None) as absent
# Alternative is to cast None to null in layout.models._create_tag_dict
if md_val is None:
continue
tag_string = '{}_{}'.format(bf.path, md_key)
# Skip pairs that were already found in the filenames
if tag_string in all_tags:
Expand Down

0 comments on commit c732750

Please sign in to comment.