eschutho opened a new pull request, #34584:
URL: https://github.com/apache/superset/pull/34584
### SUMMARY
Added defensive initialization checks to prevent application startup
failures
when database tables haven't been created yet. The application now
gracefully skips database-dependent features during initialization if the
database is not ready, allowing successful startup even before migrations
have run.
The key change is the introduction of a
`_init_database_dependent_features()`
method that checks for table existence before attempting to initialize
features like the tagging system and theme seeding. This prevents
`OperationalError` exceptions that would otherwise crash the application
during startup.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable - backend initialization change only
### TESTING INSTRUCTIONS
1. Run the new unit tests: `pytest tests/unit_tests/initialization_test.py
-v`
2. To manually test the fix:
- Start with a fresh database (no tables created)
- Start the Superset application
- Verify the application starts without errors
- Check logs for: "Superset tables not yet created. Skipping
database-dependent initialization"
- Run migrations: `superset db upgrade`
- Restart the application
- Verify all features initialize properly
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] 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
**Author:** Claude (Anthropic's AI Assistant)
**Co-authored-by:** Elizabeth Thompson
--
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]