betodealmeida opened a new pull request #12292: URL: https://github.com/apache/superset/pull/12292
### SUMMARY <!--- Describe the change below, including rationale and design decisions --> The new examples, based on the import/export format, were loading data into the main database instead of the examples database. The code worked correctly when the two were identical, but at Preset we use 2 different databases and the data was loaded into the incorrect one. I fixed by explicitly calling `get_example_database()` in order to (1) check if the table already exists and, if not, (2) to create the table and load the data. Note that when the main and the example databases are the same we reuse the session connection, to make the import atomic. If they're different we warn the user (via logging) that the data import will happen outside the import transaction. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> N/A ### TEST PLAN <!--- What steps should be taken to verify the changes --> Tested locally. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Changes UI - [ ] Requires DB Migration. - [ ] Confirm DB Migration upgrade and downgrade tested. - [ ] Introduces new feature or API - [ ] Removes existing feature or API ---------------------------------------------------------------- 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]
