Skip to content

Commit

Permalink
handle list fields
Browse files Browse the repository at this point in the history
  • Loading branch information
brimoor committed Dec 12, 2024
1 parent 68eb682 commit 8331661
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fiftyone/core/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -10712,9 +10712,9 @@ def _get_media_fields(self, whitelist=None, blacklist=None, frames=False):

return media_fields

def _resolve_media_field(self, media_field):
def _parse_media_field(self, media_field):
if media_field in self._dataset.app_config.media_fields:
return media_field
return media_field, None

_media_field, is_frame_field = self._handle_frame_field(media_field)

Expand All @@ -10730,7 +10730,13 @@ def _resolve_media_field(self, media_field):
if is_frame_field:
_resolved_field = self._FRAMES_PREFIX + _resolved_field

return _resolved_field
_list_fields = self._parse_field_name(
_resolved_field, auto_unwind=False
)[-2]
if _list_fields:
return _resolved_field, _list_fields[0]

return _resolved_field, None

raise ValueError("'%s' is not a valid media field" % media_field)

Expand Down

0 comments on commit 8331661

Please sign in to comment.