Skip to content

ExcelWriter mode error #356

Closed
Closed
@cameronb-ma

Description

@cameronb-ma

Describe the bug
"a" should be allowed for mode argument of ExcelWriter

To Reproduce

import pandas as pd

df = pd.DataFrame([["ABC", "XYZ"]], columns=["Foo", "Bar"])
with pd.ExcelWriter("path_to_file.xlsx", mode="a", engine="openpyxl") as writer:
    df.to_excel(writer, sheet_name="Example_Sheet")

mypy reports

Argument "mode" to "ExcelWriter" has incompatible type "Literal['a']"; expected "Union[Literal['w'], Literal['writer']]"

Please complete the following information:

  • OS: MacOS Monterey 12.6
  • python version 3.9.10
  • mypy version 0.931
  • pandas version 1.5.0
  • pandas-stubs version 1.5.0.221003

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions