villebro commented on a change in pull request #8457: [fix] Improve csv upload
functionality
URL:
https://github.com/apache/incubator-superset/pull/8457#discussion_r342791786
##########
File path: superset/views/database/views.py
##########
@@ -117,32 +117,58 @@ def form_post(self, form):
try:
utils.ensure_path_exists(config["UPLOAD_FOLDER"])
csv_file.save(path)
- table = SqlaTable(table_name=form.name.data)
- table.database = form.data.get("con")
- table.database_id = table.database.id
- table.database.db_engine_spec.create_table_from_csv(form, table)
+ table_name = form.name.data
Review comment:
I took a second look at this method, and I agree, it's becoming rather
sizeable and difficult to maintain. I did consider refactoring this more, but
decided against it, as there was already quite a few big changes happening (I
already threw in a few integration tests to feel less guilty
😆). I don't mind taking another stab at cleaning this up, but would prefer
to do it in one or even two separate PRs, as I believe it will require a fairly
big effort that falls beyond the scope of this fix. However, if there are
strong feelings to the contrary I am happy to take another look at refactoring
this more.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]