Skip to content

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

Merged
merged 2 commits into from
Jan 8, 2021

Conversation

lithomas1
Copy link
Member

@lithomas1 lithomas1 commented Jan 6, 2021

cc @rhshadrach

Copy link
Member

@rhshadrach rhshadrach left a 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!

@@ -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,
Copy link
Member

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?

if isinstance(content, bytes):
content_or_path = BytesIO(content)
else:
content_or_path = content or path
assert content_or_path is not None
Copy link
Member

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.

@jreback jreback added this to the 1.3 milestone Jan 6, 2021
@jreback jreback added the IO Excel read_excel, to_excel label Jan 6, 2021
@@ -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,
Copy link
Contributor

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)

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. cc @rhshadrach

@lithomas1 lithomas1 requested a review from rhshadrach January 8, 2021 18:34
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@rhshadrach rhshadrach merged commit 2399688 into pandas-dev:master Jan 8, 2021
@rhshadrach
Copy link
Member

Thanks @lithomas1!

@lithomas1 lithomas1 deleted the cln-inspect-excel-format branch January 8, 2021 22:11
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLN: Simplify inspect_excel_format
3 participants