Skip to content

Update DataFrame.to_feather() docstring/api documentation and deprecate fname argument. #29532

Closed
@simonjayhawkins

Description

@simonjayhawkins

Code Sample, a copy-pastable example if possible

This code works.

import pandas as pd
import pandas.util.testing as tm
from io import BytesIO

df = pd.DataFrame({"a": [1, 2, 3], "b": list("abc")})

buf = BytesIO()
df.to_feather(fname=buf)
result = pd.read_feather(path=buf)

tm.assert_frame_equal(result, df)

Problem description

Documentation doesn't mention accepting a buffer.

    def to_feather(self, fname):
        """
        Write out the binary feather-format for DataFrames.

        Parameters
        ----------
        fname : str
            String file path.
        """

Expected Output

change argument name to better reflect types accepted and be consistent with other io methods.

would need to deprecate fname argument.

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

Metadata

Metadata

Assignees

No one assigned

    Labels

    API - ConsistencyInternal Consistency of API/BehaviorDeprecateFunctionality to remove in pandasDocsIO Parquetparquet, feather

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions