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
Added functionality to import perfect Excel #3059
Conversation
Out of curiosity, what is "perfect Excel"? |
Hi @kgodey, a perfect Excel has a single sheet with a single table in it. This PR gets the basic functionality of importing Excel files into the codebase. Later PRs will introduce a |
Thanks @IamEzio! |
@dmos62 @Anish9901 PTAL. Thanks! |
@dmos62 I have updated the PR. PTAL. Thanks! |
We pass 'records' as the orientation parameter because we want each record to contain | ||
data of a single row and not of a single column (which is the default behaviour). | ||
""" | ||
return json.loads(df.to_json(orient='records')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clear 👍
mathesar/imports/excel.py
Outdated
try: | ||
table = insert_data_from_excel_data_file(name, schema, column_names, engine, comment, excel_filepath) | ||
table = insert_data_from_excel_data_file(name, schema, column_names, engine, comment, dataframe) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be renamed to
table = insert_data_from_excel_data_file(name, schema, column_names, engine, comment, dataframe) | |
table = insert_data_from_dataframe(name, schema, column_names, engine, comment, dataframe) |
because, you're inserting from a dataframe here, it coming from excel is irrelevant (correct me if I'm wrong), or even
table = insert_data_from_excel_data_file(name, schema, column_names, engine, comment, dataframe) | |
table = insert_records_from_dataframe(name, schema, column_names, engine, comment, dataframe) |
because, you refered to data as records
in another place: both data
and records
work, imo, but you want to be consistent with how you're referring to rows/data/records.
6bdb38a
Fixes part of #3027
This PR adds methods to import Excel files into Mathesar.
Screenshots
perfect-excel.mp4
Checklist
Update index.md
).develop
branch of the repositoryvisible errors.
Developer Certificate of Origin
Developer Certificate of Origin