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

Add ExcelHandler #1962

Merged
merged 9 commits into from May 2, 2024
Merged

Add ExcelHandler #1962

merged 9 commits into from May 2, 2024

Conversation

pvk-developer
Copy link
Member

Resolves #1950
CU-86b05t4z0

@sdv-team
Copy link
Contributor

Task linked: CU-86b05t4z0 SDV - Add ExcelHandler #1950

@pvk-developer pvk-developer changed the base branch from main to issue-1949-add-csvhandler April 25, 2024 16:54
@pvk-developer pvk-developer marked this pull request as ready for review April 29, 2024 08:54
@pvk-developer pvk-developer requested a review from a team as a code owner April 29, 2024 08:54
@pvk-developer pvk-developer requested review from amontanez24 and R-Palazzo and removed request for a team April 29, 2024 08:54
Copy link
Contributor

@R-Palazzo R-Palazzo left a comment

Choose a reason for hiding this comment

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

Looks good!

I just have 1 or 2 questions.


@patch('sdv.io.local.local.pd')
def test_write(self, mock_pd):
# Setup
Copy link
Contributor

Choose a reason for hiding this comment

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

Add test docstring

sdv/io/local/local.py Show resolved Hide resolved
"""A class for handling Excel files."""

def read(self, file_path, sheet_names=None):
"""Read data from Excel files and returns it along with metadata.
Copy link
Contributor

Choose a reason for hiding this comment

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

return

sheet_names = xl_file.sheet_names

for sheet_name in sheet_names:
data[sheet_name] = pd.read_excel(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a check that the sheet_name exists in the file_path here? Or it's ok to let pandas raise an error

pyproject.toml Outdated
Comment on lines 42 to 43
'xlsxwriter>=3.1.0',
'openpyxl>=3.1.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

After speaking with @npatki I think we should make these optional dependencies. I would also just refer to pandas' dependencies instead of maintaining this ourselves. Something like

[project.optional-dependencies]
excel_handler = [
    'pandas[excel]'
]

sdv/io/local/local.py Show resolved Hide resolved
Base automatically changed from issue-1949-add-csvhandler to main April 29, 2024 20:31
@pvk-developer pvk-developer merged commit 60ae555 into main May 2, 2024
37 checks passed
@pvk-developer pvk-developer deleted the issue-1950-add-excelhandler branch May 2, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ExcelHandler
4 participants