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

Make pandas.ExcelFile(...) in stubs consistent with the run time version. #1117

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

cainmagi
Copy link
Contributor

@cainmagi cainmagi commented Feb 12, 2025

Introduction

The changes make the signature of

def __init__(
self,
io: FilePath | ReadBuffer[bytes] | bytes,
engine: ExcelReadEngine | None = ...,
storage_options: StorageOptions = ...,
) -> None: ...

consistent with the run time version:

https://github.com/pandas-dev/pandas/blob/0691c5cf90477d3503834d983f69350f250a6ff7/pandas/io/excel/_base.py#L1507-L1513

Fixes

  • The first argument name should be path_or_buffer, not io. (The property ExcelFile(...).io is correct. No need to change this.)
  • The keyword engine_kwargs is added.
  • The keyword storage_options should allow a None value. Sorry, I found that None case has been included here. No need to make changes for this.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cainmagi

@Dr-Irv Dr-Irv merged commit a5a40a7 into pandas-dev:main Feb 13, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The signature of pandas.ExcelFile(...) in stubs is not consistent with the run-time signature.
2 participants