6d1541e1782a7b94797d5432922e64a97934cfa4,pandas/io/feather_format.py,,to_feather,#Any#Any#Any#,13

Before Change


    import_optional_dependency("pyarrow")
    from pyarrow import feather

    ioargs = get_filepath_or_buffer(path, mode="wb", storage_options=storage_options)

    if not isinstance(df, DataFrame):
        raise ValueError("feather only support IO with DataFrames")

    valid_types = {"string", "unicode"}

    // validate index
    // --------------

    // validate that we have only a default index
    // raise on anything else as we don"t serialize the index

    if not isinstance(df.index, Int64Index):
        typ = type(df.index)
        raise ValueError(
            f"feather does not support serializing {typ} "
            "for the index; you can .reset_index() to make the index into column(s)"
        )

    if not df.index.equals(RangeIndex.from_range(range(len(df)))):
        raise ValueError(
            "feather does not support serializing a non-default index for the index; "
            "you can .reset_index() to make the index into column(s)"
        )

    if df.index.name is not None:
        raise ValueError(
            "feather does not serialize index meta-data on a default index"
        )

    // validate columns
    // ----------------

    // must have value column names (strings only)
    if df.columns.inferred_type not in valid_types:
        raise ValueError("feather must have string column names")

    feather.write_feather(df, ioargs.filepath_or_buffer, **kwargs)

    ioargs.close()


def read_feather(
    path, columns=None, use_threads: bool = True, storage_options: StorageOptions = None

After Change


    if df.columns.inferred_type not in valid_types:
        raise ValueError("feather must have string column names")

    with get_handle(
        path, "wb", storage_options=storage_options, is_text=False
    ) as handles:
        feather.write_feather(df, handles.handle, **kwargs)


def read_feather(
    path, columns=None, use_threads: bool = True, storage_options: StorageOptions = None
):
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pandas-dev/pandas
Commit Name: 6d1541e1782a7b94797d5432922e64a97934cfa4
Time: 2020-11-13
Author: twoertwein@users.noreply.github.com
File Name: pandas/io/feather_format.py
Class Name:
Method Name: to_feather


Project Name: pandas-dev/pandas
Commit Name: 6d1541e1782a7b94797d5432922e64a97934cfa4
Time: 2020-11-13
Author: twoertwein@users.noreply.github.com
File Name: pandas/io/orc.py
Class Name:
Method Name: read_orc


Project Name: pandas-dev/pandas
Commit Name: 6d1541e1782a7b94797d5432922e64a97934cfa4
Time: 2020-11-13
Author: twoertwein@users.noreply.github.com
File Name: pandas/io/feather_format.py
Class Name:
Method Name: read_feather