exemplary-citizen opened a new issue #16046:
URL: https://github.com/apache/superset/issues/16046
**Is your feature request related to a problem? Please describe.**
```
class CsvToDatabaseForm(DynamicForm):
# pylint: disable=E0211
def csv_allowed_dbs() -> List[Database]: # type: ignore
csv_enabled_dbs = (
db.session.query(Database).filter_by(allow_csv_upload=True).all()
)
return [
csv_enabled_db
for csv_enabled_db in csv_enabled_dbs
if
CsvToDatabaseForm.at_least_one_schema_is_allowed(csv_enabled_db)
]
```
There's unnecessary duplication here between CSV and other forms.
**Describe the solution you'd like**
We should abstract this into a class `UploadToDatabaseForm(DynamicForm)`
with all the repeated boilerplate and then extend those into class
`CsvToDatabaseForm(UploadToDatabaseForm)`, class
`ExcelToDatabaseForm(UploadToDatabaseForm)` etc.
cc: @villebro
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]