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

Removed **kwds from parse function in read_excel #51218

Closed
wants to merge 3 commits into from
Closed

Removed **kwds from parse function in read_excel #51218

wants to merge 3 commits into from

Conversation

pacificdragon
Copy link

The code works fine locally.

image

Checking CI/CD pipeline now.

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

This would need tests, but apart from that this is an API change, not sure if we can do this without a deprecation cycle

@rhshadrach
Copy link
Member

In the comment below, I'm assuming that all valid kwargs that can be passed to parse are still available, but haven't confirmed that yet.

this is an API change, not sure if we can do this without a deprecation cycle

Part of this change is raising if a user passes invalid keyword args. I think we can regard this as a bugfix. I guess this change might also mess up someone who is using positional arguments - I'd have to guess that is quite rare but I suppose that aspect is an API change. Would you agree?

@rhshadrach rhshadrach added IO Excel read_excel, to_excel Bug Error Reporting Incorrect or improved errors from pandas labels Feb 9, 2023
@phofl
Copy link
Member

phofl commented Feb 9, 2023

No problem with making the keywords explicit, but would prefer keeping the order, also would rather deprecate the kwargs instead of removing outright, like we did in other places with unused kwargs

@rhshadrach
Copy link
Member

I think the way forward is to emit a FutureWarning if invalid kwargs are in present. I assume @pacificdragon added the keyword arguments in their current locations to agree with the ordering of other methods, but I haven't checked this. We currently can't add new arguments unless they are at the end to retain backwards compatibility. For this, I think there are two ways forward:

a. Add keywords to the tail end of the signature
b. Deprecate specifying any argument other than sheet_name by position

If we go with (a), we'll still have different ordering of arguments which isn't great. With (b), we can add arguments in any order after the deprecation is enforced. So I'd lean toward (b) here unless it's preferred that these arguments are allowed to be positional.

@phofl
Copy link
Member

phofl commented Feb 9, 2023

b sounds good, also +1 on adding a FutureWarning and removing in 3.0

@WillAyd
Copy link
Member

WillAyd commented Feb 10, 2023

I would actually be OK with doing this without a deprecation cycle. I think it is a bug for a function to silently accept arguments it does nothing with. We also have a precedent for doing this in the excel space like #34464

@pacificdragon pacificdragon closed this by deleting the head repository Feb 11, 2023
@pacificdragon
Copy link
Author

Thanks, Everyone for taking action on this. @rhshadrach Created PR for the same 51331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error Reporting Incorrect or improved errors from pandas IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: xl.parse index_col ignoring skiprows
4 participants