Skip to content

Commit c3cf1b8

Browse files
Moisanyehoshuadimarsky
authored andcommitted
TYP: add type annotation to DataFrame.to_pickle (pandas-dev#46262)
1 parent 19f6b23 commit c3cf1b8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/core/generic.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,7 @@ def to_sql(
29562956
)
29572957
def to_pickle(
29582958
self,
2959-
path,
2959+
path: FilePath | WriteBuffer[bytes],
29602960
compression: CompressionOptions = "infer",
29612961
protocol: int = pickle.HIGHEST_PROTOCOL,
29622962
storage_options: StorageOptions = None,
@@ -2966,8 +2966,10 @@ def to_pickle(
29662966
29672967
Parameters
29682968
----------
2969-
path : str
2970-
File path where the pickled object will be stored.
2969+
path : str, path object, or file-like object
2970+
String, path object (implementing ``os.PathLike[str]``), or file-like
2971+
object implementing a binary ``write()`` function. File path where
2972+
the pickled object will be stored.
29712973
{compression_options}
29722974
protocol : int
29732975
Int which indicates which protocol should be used by the pickler,

0 commit comments

Comments
 (0)