def delete_saved_view(dataset_name, view_name, dry_run=False):
    """Deletes the saved view with the given name from the dataset with the
    given name.

    This is a low-level implementation of deletion that does not call
    :meth:`fiftyone.core.dataset.load_dataset` or
    :meth:`fiftyone.core.collections.SampleCollection.load_saved_view`,
    which is helpful if a dataset's backing document or collections are
    corrupted and cannot be loaded via the normal pathways.

    Args:
        dataset_name: the name of the dataset
        view_name: the name of the saved view
        dry_run (False): whether to log the actions that would be taken but not
            perform them
    """
    conn = get_db_conn()
    _logger = _get_logger(dry_run=dry_run)

    dataset_dict = conn.datasets.find_one({"name": dataset_name})
    if not dataset_dict:
        _logger.warning("Dataset '%s' not found", dataset_name)
        return

    dataset_id = dataset_dict["_id"]
    saved_views = dataset_dict.get("saved_views", [])

    # {name: id} in `views` collection
    sd = {}
    for saved_view_dict in conn.views.find({"_dataset_id": dataset_id}):
        try:
            sd[saved_view_dict["name"]] = saved_view_dict["_id"]
        except:
            pass

    del_id = sd.get(view_name, None)
    if del_id is None:
        _logger.warning(
            "Dataset '%s' has no saved view '%s'", dataset_name, view_name
        )
        return

    _logger.info(
        "Deleting saved view %s' with ID '%s' from dataset '%s'",
        view_name,
        del_id,
        dataset_name,
    )

    saved_views = [_id for _id in saved_views if _id != del_id]

    if not dry_run:
        conn.datasets.update_one(
            {"name": dataset_name},
            {"$set": {"saved_views": saved_views}},
        )
        _delete_saved_views(conn, [del_id])
Deletes the saved view with the given name from the dataset with the
    given name.

    This is a low-level implementation of deletion that does not call
    :meth:`fiftyone.core.dataset.load_dataset` or
    :meth:`fiftyone.core.collections.SampleCollection.load_saved_view`,
    which is helpful if a dataset's backing document or collections are
    corrupted and cannot be loaded via the normal pathways.

    Args:
        dataset_name: the name of the dataset
        view_name: the name of the saved view
        dry_run (False): whether to log the actions that would be taken but not
            perform them
    
fiftyone/core/odm/database.py