-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: inspect_excel_format #39008
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
CLN: inspect_excel_format #39008
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this up!
pandas/io/excel/_base.py
Outdated
@@ -906,24 +906,18 @@ def close(self): | |||
|
|||
@doc(storage_options=_shared_docs["storage_options"]) | |||
def inspect_excel_format( | |||
path: Optional[str] = None, | |||
content: Union[None, BufferedIOBase, RawIOBase, bytes] = None, | |||
content_or_path: Union[None, str, BufferedIOBase, RawIOBase, IO[bytes]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the default value or type None is necessary here, is that right?
pandas/io/excel/_base.py
Outdated
if isinstance(content, bytes): | ||
content_or_path = BytesIO(content) | ||
else: | ||
content_or_path = content or path | ||
assert content_or_path is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the above, would be okay to remove this line.
pandas/io/excel/_base.py
Outdated
@@ -906,24 +906,18 @@ def close(self): | |||
|
|||
@doc(storage_options=_shared_docs["storage_options"]) | |||
def inspect_excel_format( | |||
path: Optional[str] = None, | |||
content: Union[None, BufferedIOBase, RawIOBase, bytes] = None, | |||
content_or_path: Union[None, str, BufferedIOBase, RawIOBase, IO[bytes]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could just be Buffer? (and I would call the arg buffer)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. cc @rhshadrach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks @lithomas1! |
cc @rhshadrach