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

DEPR: **kwargs in ExcelWriter #40430

Merged
merged 6 commits into from
Mar 17, 2021
Merged

Conversation

rhshadrach
Copy link
Member

  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

Currently ExcelWriter has **engine_kwargs to pass through to the engine, although this is undocumented. All other places in pandas where engine_kwargs is used, they are a regular argument.

This PR

  • Renames **engine_kwargs to **kwargs (not an API change)
  • Adds **kwargs to the docstring of ExcelWriter
  • Deprecates **kwargs
  • Introduces engine_kwargs as a regular argument for their replacement

@rhshadrach rhshadrach added IO Excel read_excel, to_excel Deprecate Functionality to remove in pandas API - Consistency Internal Consistency of API/Behavior labels Mar 14, 2021
pandas/io/excel/_base.py Show resolved Hide resolved
pandas/io/excel/_base.py Show resolved Hide resolved
@@ -835,7 +862,8 @@ def __init__(
datetime_format=None,
mode: str = "w",
storage_options: StorageOptions = None,
**engine_kwargs,
engine_kwargs: Optional[Dict] = None,
**kwargs,
Copy link
Contributor

Choose a reason for hiding this comment

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

and not do this

):
if kwargs:
if engine_kwargs is not None:
raise ValueError("Cannot use both engine_kwargs and **kwargs")
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a test for this

@rhshadrach
Copy link
Member Author

Thanks @jreback - changes made and green. I might not have understood your comment about setting engine_kwargs = kwargs, response is above.

@jreback jreback added this to the 1.3 milestone Mar 17, 2021
@jreback jreback merged commit 7e0f5ca into pandas-dev:master Mar 17, 2021
@jreback
Copy link
Contributor

jreback commented Mar 17, 2021

thanks @rhshadrach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Deprecate Functionality to remove in pandas IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants