Skip to content

Latest typeshed changes break a couple of tests in pandas-stubs #729

Closed
@erictraut

Description

@erictraut

Just a heads up that tomorrow's release of pyright 1.1.314 will include the latest typeshed changes. The most significant of these changes are prompted by PEP 688. These changes break a couple of tests in pandas-stubs. You should see the same behaviors with mypy once it ships the next release with an updated typeshed.

The errors are as follows:

  • In test_types_to_csv (within test_frame.py), passing an instance of io.BytesIO as the first argument to df.to_csv no longer works. This is because io.BytesIO no longer satisfies the WriteBuffer[bytes] | WriteBuffer[str] types defined in the pandas stubs.
  • In test_orc_buffer (within test_io.py), the first check statement fails because file_w is an instance of io.BufferedWriter, and this is no longer compatible with the WriteBuffer[bytes] type defined in the pandas stubs.

@JelleZijlstra, for your visibility. I'm guessing that these showed up in the mypy_primer output when the typeshed changes went in?

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