Skip to content

Commit

Permalink
closes pandas-dev#44914 by changing the path object to string if it i…
Browse files Browse the repository at this point in the history
…s of io.BufferedWriter type.
  • Loading branch information
Anirudhsekar96 committed Jan 19, 2022
1 parent 6b43a78 commit 0963f7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ I/O
- Bug in :func:`read_json` raising ``ValueError`` when attempting to parse json strings containing "://" (:issue:`36271`)
- Bug in :func:`read_csv` when ``engine="c"`` and ``encoding_errors=None`` which caused a segfault (:issue:`45180`)
- Bug in :func:`read_csv` an invalid value of ``usecols`` leading to an un-closed file handle (:issue:`45384`)
- Bug in :func:`read_parquet` when ``engine="pyarrow"`` which caused partial write to disk when column of unsupported datatype was passed (:issue:`44914`)

Period
^^^^^^
Expand Down
3 changes: 3 additions & 0 deletions pandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def write(
mode="wb",
is_dir=partition_cols is not None,
)
if isinstance(path_or_handle, WriteBuffer):
path_or_handle = path_or_handle.raw.name

try:
if partition_cols is not None:
# writes to multiple files under the given path
Expand Down

0 comments on commit 0963f7a

Please sign in to comment.