betodealmeida opened a new pull request #15804: URL: https://github.com/apache/superset/pull/15804
### SUMMARY <!--- Describe the change below, including rationale and design decisions --> When identifying models, the benchmark migration script should also take into consideration models that are referenced in foreign keys. For example, running the script on `301362411006_add_execution_id_to_report_execution_.py` would identify a single model, for the `report_execution_log` table. But that table has a foreign key to `report_schedule.id`. On a particular run the script was failing because `report_schedule` was empty. I changed the script to also populate the models referenced in foreign keys. Ideally we'd need only 1 entity for each of those models, but for now the script generates multiple entities of them as well. I'll clean it up in a follow up PR. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> N/A ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> Make sure you have no reports scheduled. Run: ``` % python scripts/benchmark_migration.py superset/migrations/versions/301362411006_add_execution_id_to_report_execution_.py ``` It should work: ``` Results: Current: 0.20 s 10+: 0.37 s 100+: 0.19 s 1000+: 0.20 s ``` ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] 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. 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]
