Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes mypy attribute issue in io/parquet by adding a hasattr check #45570

Merged
merged 10 commits into from
Jan 23, 2022
3 changes: 2 additions & 1 deletion pandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def write(
is_dir=partition_cols is not None,
)
if isinstance(path_or_handle, io.BufferedWriter):
Anirudhsekar96 marked this conversation as resolved.
Show resolved Hide resolved
path_or_handle = path_or_handle.raw.name
if hasattr(path_or_handle.raw, "name"):
path_or_handle = path_or_handle.raw.name

try:
if partition_cols is not None:
Expand Down