def _get_source_info(
    name: str,
    latest_version: str,
    catalog,
) -> tuple[
    Optional[str], Optional[str], Optional[str], Optional[list[DatasetDependency]]
]:
    """Get source dataset information and dependencies.

    Returns:
        Tuple of (source_name, source_version, source_latest_version, dependencies)
        Returns (None, None, None, None) if source dataset was removed.
    """
    dependencies = catalog.get_dataset_dependencies(
        name, latest_version, indirect=False
    )

    dep = dependencies[0]
    if not dep:
        # Starting dataset was removed, back off to normal dataset creation
        return None, None, None, None

    source_ds_name = dep.name
    source_ds_version = dep.version
    source_ds_latest_version = catalog.get_dataset(source_ds_name).latest_version

    return source_ds_name, source_ds_version, source_ds_latest_version, dependencies
Get source dataset information and dependencies.

    Returns:
        Tuple of (source_name, source_version, source_latest_version, dependencies)
        Returns (None, None, None, None) if source dataset was removed.
    
src/datachain/delta.py