def validate_field_type(
        self,
        path,
        ftype=None,
        embedded_doc_type=None,
        subfield=None,
    ):
        """Validates that the collection has a field of the given type.

        Args:
            path: a field name or ``embedded.field.name``
            ftype (None): an optional field type or iterable of types to
                enforce. Must be subclass(es) of
                :class:`fiftyone.core.fields.Field`
            embedded_doc_type (None): an optional embedded document type or
                iterable of types to enforce. Must be subclass(es) of
                :class:`fiftyone.core.odm.BaseEmbeddedDocument`
            subfield (None): an optional subfield type or iterable of subfield
                types to enforce. Must be subclass(es) of
                :class:`fiftyone.core.fields.Field`

        Raises:
            ValueError: if the field does not exist or does not have the
                expected type
        """
        field = self.get_field(
            path,
            ftype=ftype,
            embedded_doc_type=embedded_doc_type,
            subfield=subfield,
        )

        if field is None:
            _path, is_frame_field = self._handle_frame_field(path)
            ftype = "frame field" if is_frame_field else "field"
            raise ValueError(
                "%s has no %s '%s'" % (self.__class__.__name__, ftype, _path)
            )
Validates that the collection has a field of the given type.

        Args:
            path: a field name or ``embedded.field.name``
            ftype (None): an optional field type or iterable of types to
                enforce. Must be subclass(es) of
                :class:`fiftyone.core.fields.Field`
            embedded_doc_type (None): an optional embedded document type or
                iterable of types to enforce. Must be subclass(es) of
                :class:`fiftyone.core.odm.BaseEmbeddedDocument`
            subfield (None): an optional subfield type or iterable of subfield
                types to enforce. Must be subclass(es) of
                :class:`fiftyone.core.fields.Field`

        Raises:
            ValueError: if the field does not exist or does not have the
                expected type
        
fiftyone/core/collections.py