Skip to content

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
@@ -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