def delete_run(cls, samples, key, cleanup=True):
        """Deletes the results associated with the given run key from the
        collection.

        Args:
            samples: a :class:`fiftyone.core.collections.SampleCollection`
            key: a run key
            cleanup (True): whether to execute the run's
                :meth:`BaseRun.cleanup` method
        """
        run_doc = cls._get_run_doc(samples, key)

        if cleanup:
            try:
                # Execute cleanup() method
                run_info = cls.get_run_info(samples, key)
                run = run_info.config.build()
                run.cleanup(samples, key)
            except Exception as e:
                logger.warning(
                    "Failed to run cleanup() for the %s with key '%s': %s",
                    cls._run_str(),
                    key,
                    str(e),
                )

        dataset = samples._root_dataset

        # Delete run from dataset
        run_docs = getattr(dataset._doc, cls._runs_field())
        try:
            # DON'T use pop()! https://github.com/voxel51/fiftyone/issues/4322
            del run_docs[key]
        except KeyError:
            pass
        results_cache = getattr(dataset, cls._results_cache_field())
        run_results = results_cache.pop(key, None)
        if run_results is not None:
            run_results._key = None

        if not isinstance(run_doc, DBRef):
            # Must manually delete run result, which is stored via GridFS
            if run_doc.results:
                run_doc.results.delete()

            run_doc.delete()

        dataset.save()
Deletes the results associated with the given run key from the
        collection.

        Args:
            samples: a :class:`fiftyone.core.collections.SampleCollection`
            key: a run key
            cleanup (True): whether to execute the run's
                :meth:`BaseRun.cleanup` method
        
fiftyone/core/runs.py