Example #1
0
File: io.py Project: ghuls/polars
def read_ipc_schema(
        file: Union[str, BinaryIO, Path, bytes]) -> Dict[str, Type[DataType]]:
    """
    Get a schema of the IPC file without reading data.

    Parameters
    ----------
    file
        Path to a file or a file like object.

    Returns
    -------
    Dictionary mapping column names to datatypes
    """
    return _ipc_schema(file)
Example #2
0
def read_ipc_schema(
        file: str | BinaryIO | Path | bytes) -> dict[str, type[DataType]]:
    """
    Get a schema of the IPC file without reading data.

    Parameters
    ----------
    file
        Path to a file or a file-like object.

    Returns
    -------
    Dictionary mapping column names to datatypes
    """
    if isinstance(file, (str, Path)):
        file = format_path(file)

    return _ipc_schema(file)