def read_listing_dataset(
    name: str,
    version: Optional[str] = None,
    path: str = "",
    session: Optional["Session"] = None,
    settings: Optional[dict] = None,
) -> tuple["DataChain", "DatasetVersion"]:
    """Read a listing dataset and return a DataChain and listing version.

    Args:
        name: Name of the dataset
        version: Version of the dataset
        path: Path within the listing to read. Path can have globs.
        session: Optional Session object to use for reading
        settings: Optional settings dictionary to use for reading

    Returns:
        tuple[DataChain, DatasetVersion]: A tuple containing:
            - DataChain configured for listing files
            - DatasetVersion object for the specified listing version

    Example:
        ```py
        import datachain as dc
        chain, listing_version = dc.read_listing_dataset(
            "lst__s3://my-bucket/my-path", version="1.0.0", path="my-path"
        )
        chain.show()
        ```
    """
    # Configure and return a DataChain for reading listing dataset files
    # Uses ReadOnlyQueryStep to avoid warehouse metadata lookups
    from datachain.lib.dc import Sys
    from datachain.lib.file import File

    from .datachain import DataChain

    if not name.startswith(LISTING_PREFIX):
        name = LISTING_PREFIX + name

    session = Session.get(session)
    dataset = session.catalog.get_dataset(name)
    if version is None:
        version = dataset.latest_version

    query = DatasetQuery(
        name=name,
        session=session,
        indexing_column_types=File._datachain_column_types,
        fallback_to_studio=False,
    )
    if settings:
        cfg = {**settings}
        if "prefetch" not in cfg:
            cfg["prefetch"] = 0
        _settings = Settings(**cfg)
    else:
        _settings = Settings(prefetch=0)
    signal_schema = SignalSchema({"sys": Sys, "file": File})

    query.starting_step = ReadOnlyQueryStep(query.catalog, name, version)
    query.version = version
    # We already know that this is a listing dataset,
    # so we can set the listing function to True
    query.set_listing_fn(lambda: True)

    chain = DataChain(query, _settings, signal_schema)
    chain = ls(chain, path, recursive=True, column="file")

    return chain, dataset.get_version(version)
Read a listing dataset and return a DataChain and listing version.

    Args:
        name: Name of the dataset
        version: Version of the dataset
        path: Path within the listing to read. Path can have globs.
        session: Optional Session object to use for reading
        settings: Optional settings dictionary to use for reading

    Returns:
        tuple[DataChain, DatasetVersion]: A tuple containing:
            - DataChain configured for listing files
            - DatasetVersion object for the specified listing version

    Example:
        ```py
        import datachain as dc
        chain, listing_version = dc.read_listing_dataset(
            "lst__s3://my-bucket/my-path", version="1.0.0", path="my-path"
        )
        chain.show()
        ```
    
src/datachain/lib/dc/listings.py