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

Multisheet load/save consistency in ExcelDataSet #907

Closed
sbrugman opened this issue Sep 23, 2021 · 1 comment
Closed

Multisheet load/save consistency in ExcelDataSet #907

sbrugman opened this issue Sep 23, 2021 · 1 comment
Labels
Issue: Bug Report 🐞 Bug that needs to be fixed

Comments

@sbrugman
Copy link
Contributor

sbrugman commented Sep 23, 2021

The PR [#867] introduces a new class MultisheetExcelDataSet that is able to write multiple sheets to an excel file. The load functionality is not implemented. As an alternative it is suggested to load each sheet separately while specifying each sheet name.

According to the pandas documentation read_excel, which is used in ExcelDataSet, returns a dictionary of all sheets if parameter sheet_name is set to None. It's also possible to specify a list of sheet names, returning a dictionary of that subset of sheets.

This means that strictly speaking, the return type of this function is Union[pd.DataFrame, Dict[str, pd.DataFrame]] (assuming str sheet names, as per pandas docs).

This introduces inconsistency between the save and load functions of the ExcelDataSet. A logical solution is to support writing multiple sheets to excel to mitigate this. For this, PR [#867] should be modified to incorporate the MultisheetExcelDataSet into the ExcelDataSet. Introducing this new class is then obviated.

@sbrugman sbrugman added the Issue: Bug Report 🐞 Bug that needs to be fixed label Sep 23, 2021
louisdecharson pushed a commit to louisdecharson/kedro that referenced this issue Oct 3, 2021
@antonymilne
Copy link
Contributor

Done in #963, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Bug Report 🐞 Bug that needs to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants