python/ray/data/read_api.py
def from_pandas_refs(
    dfs: Union[ObjectRef["pandas.DataFrame"], List[ObjectRef["pandas.DataFrame"]]]
) -> Dataset[ArrowRow]:
    """Create a dataset from a list of Ray object references to Pandas
    dataframes.

    Args:
        dfs: A Ray object references to pandas dataframe, or a list of
             Ray object references to pandas dataframes.

    Returns:
        Dataset holding Arrow records read from the dataframes.
    """
    if isinstance(dfs, ray.ObjectRef):
        dfs = [dfs]
    elif isinstance(dfs, list):
        for df in dfs:
            if not isinstance(df, ray.ObjectRef):
                raise ValueError(
                    "Expected list of Ray object refs, "
                    f"got list containing {type(df)}"
                )
    else:
        raise ValueError(
            "Expected Ray object ref or list of Ray object refs, " f"got {type(df)}"
        )

    context = DatasetContext.get_current()
    if context.enable_pandas_block:
        get_metadata = cached_remote_fn(_get_metadata)
        metadata = [get_metadata.remote(df) for df in dfs]
        return Dataset(
            ExecutionPlan(BlockList(dfs, ray.get(metadata)), DatasetStats.TODO()),
            0,
            False,
        )

    df_to_block = cached_remote_fn(_df_to_block, num_returns=2)

    res = [df_to_block.remote(df) for df in dfs]
    blocks, metadata = zip(*res)
    return Dataset(
        ExecutionPlan(
            BlockList(blocks, ray.get(list(metadata))),
            DatasetStats(stages={"from_pandas_refs": metadata}, parent=None),
        ),
        0,
        False,
    )
Create a dataset from a list of Ray object references to Pandas
    dataframes.

    Args:
        dfs: A Ray object references to pandas dataframe, or a list of
             Ray object references to pandas dataframes.

    Returns:
        Dataset holding Arrow records read from the dataframes.
    
Create a dataset from a list of Ray object references to Pandas
dataframes.
Create a dataset from a list of Ray object references to Pandas dataframes .
def from_pandas_refs(
    dfs: Union[ObjectRef["pandas.DataFrame"], List[ObjectRef["pandas.DataFrame"]]]
) -> Dataset[ArrowRow]:
    if isinstance(dfs, ray.ObjectRef):
        dfs = [dfs]
    elif isinstance(dfs, list):
        for df in dfs:
            if not isinstance(df, ray.ObjectRef):
                raise ValueError(
                    "Expected list of Ray object refs, "
                    f"got list containing {type(df)}"
                )
    else:
        raise ValueError(
            "Expected Ray object ref or list of Ray object refs, " f"got {type(df)}"
        )
    context = DatasetContext.get_current()
    if context.enable_pandas_block:
        get_metadata = cached_remote_fn(_get_metadata)
        metadata = [get_metadata.remote(df) for df in dfs]
        return Dataset(
            ExecutionPlan(BlockList(dfs, ray.get(metadata)), DatasetStats.TODO()),
            0,
            False,
        )
    df_to_block = cached_remote_fn(_df_to_block, num_returns=2)
    res = [df_to_block.remote(df) for df in dfs]
    blocks, metadata = zip(*res)
    return Dataset(
        ExecutionPlan(
            BlockList(blocks, ray.get(list(metadata))),
            DatasetStats(stages={"from_pandas_refs": metadata}, parent=None),
        ),
        0,
        False,
    )
def from_pandas_refs ( dfs : Union [ ObjectRef [ "pandas.DataFrame" ] , List [ ObjectRef [ "pandas.DataFrame" ] ] ] ) -> Dataset [ ArrowRow ] : if isinstance ( dfs , ray . ObjectRef ) : dfs = [ dfs ] elif isinstance ( dfs , list ) : for df in dfs : if not isinstance ( df , ray . ObjectRef ) : raise ValueError ( "Expected list of Ray object refs, " f"got list containing {type(df)}" ) else : raise ValueError ( "Expected Ray object ref or list of Ray object refs, " f"got {type(df)}" ) context = DatasetContext . get_current ( ) if context . enable_pandas_block : get_metadata = cached_remote_fn ( _get_metadata ) metadata = [ get_metadata . remote ( df ) for df in dfs ] return Dataset ( ExecutionPlan ( BlockList ( dfs , ray . get ( metadata ) ) , DatasetStats . TODO ( ) ) , 0 , False , ) df_to_block = cached_remote_fn ( _df_to_block , num_returns = 2 ) res = [ df_to_block . remote ( df ) for df in dfs ] blocks , metadata = zip ( * res ) return Dataset ( ExecutionPlan ( BlockList ( blocks , ray . get ( list ( metadata ) ) ) , DatasetStats ( stages = { "from_pandas_refs" : metadata } , parent = None ) , ) , 0 , False , )
Create a dataset from a list of Ray object references to Pandas
dataframes.
Create a dataset from a list of Ray object references to Pandas dataframes .
"""Create a dataset from a list of Ray object references to Pandas
    dataframes.

    Args:
        dfs: A Ray object references to pandas dataframe, or a list of
             Ray object references to pandas dataframes.

    Returns:
        Dataset holding Arrow records read from the dataframes.
    """
Dataset holding Arrow records read from the dataframes.
Dataset holding Arrow records read from the dataframes .
dfs
Union[ObjectRef["pandas.DataFrame"], List[ObjectRef["pandas.DataFrame"]]]
A Ray object references to pandas dataframe, or a list of
Ray object references to pandas dataframes.
A Ray object references to pandas dataframe or a list of Ray object references to pandas dataframes .