Skip to content

Commit

Permalink
versionadded, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joeperdefloep committed Sep 7, 2021
1 parent cb59157 commit b9ed327
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pandas/io/excel/_base.py
Expand Up @@ -680,7 +680,7 @@ class ExcelWriter(metaclass=abc.ABCMeta):
host, port, username, password, etc., if using a URL that will
be parsed by ``fsspec``, e.g., starting "s3://", "gcs://".
.. versionadded:: 1.2.0
.. versionadded:: 1.4.0
if_sheet_exists : {'error', 'new', 'replace', 'overwrite_cells'}, default 'error'
How to behave when trying to write to a sheet that already
exists (append mode only).
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/excel/_openpyxl.py
Expand Up @@ -437,12 +437,12 @@ def write_cells(
f"Sheet '{sheet_name}' already exists and "
f"if_sheet_exists is set to 'error'."
)
elif self.if_sheet_exists == "write_to":
elif self.if_sheet_exists == "overwrite_cells":
wks = self.sheets[sheet_name]
else:
raise ValueError(
f"'{self.if_sheet_exists}' is not valid for if_sheet_exists. "
"Valid options are 'error', 'new', 'replace' and 'write_to'."
"Valid options are 'error', 'new', 'replace' and 'overwrite_cells'."
)
else:
wks = self.sheets[sheet_name]
Expand Down

0 comments on commit b9ed327

Please sign in to comment.