madhamanchiharsha opened a new issue #12785: URL: https://github.com/apache/superset/issues/12785
A clear and concise description of what the bug is. So while importing Dataset i have 2 different schemas in postgres and in this 2 different schemas i have 2 tables with same names i cant import both table as datasets into superset. ### Expected results Both table should be accepted and create new dataset for each table as they are from 2 different schemas. ### Actual results sqlalchemy/engine/default.py", line 593, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (sqlite3.IntegrityError) UNIQUE constraint failed: tables.table_name [SQL: INSERT INTO tables (uuid, created_on, changed_on, description, default_endpoint, is_featured, filter_select_enabled, "offset", cache_timeout, params, perm, schema_perm, table_name, main_dttm_col, database_id, fetch_values_predicate, schema, sql, is_sqllab_view, template_params, extra, created_by_fk, changed_by_fk) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] [parameters: (<memory at 0x7f7fc06ea7c0>, '2021-01-27 10:27:54.715090', '2021-01-27 10:27:54.715100', None, None, 0, 0, 0, None, None, None, None, 'a6', None, 4, None, 'mr', None, 0, None, None, 2, 2)] (Background on this error at: http://sqlalche.me/e/13/gkpj) Error creating model DatasetRestApi: Dataset could not be created. ERROR:superset.datasets.api:Error creating model DatasetRestApi: Dataset could not be created. INFO:werkzeug:127.0.0.1 - - [27/Jan/2021 10:27:54] "POST /api/v1/dataset/ HTTP/1.1" 422 - #### Screenshots    #### How to reproduce the bug 1. create 2 different schemas in postgres and connect to that database in superset 2. now add schema1.table1 dataset , again add schema2.table1 4. Now you can see the error ### Environment (please complete the following information): - superset version: `1.0.0` - python version: `3.8.5` ### Checklist Make sure to follow these steps before submitting your issue - thank you! - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any. - [ ] I have reproduced the issue with at least the latest released version of superset. - [ ] I have checked the issue tracker for the same issue and I haven't found one similar. ### Additional context Add any other context about the problem here. ---------------------------------------------------------------- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
