fix(playwright): use superset shell instead of python -c in bashlib

Replace inline `python -c` block with `superset shell` heredoc, which has
the Flask app context pre-loaded. Drops the create_app()/app_context()
boilerplate and addresses review feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joe Li
2026-04-13 15:05:44 -07:00
parent 512ba43e76
commit 9b4c74f74a

View File

@@ -129,6 +129,8 @@ playwright_testdata() {
superset init
# Enable DML on the examples database so Playwright tests can create/drop
# temporary tables via SQL Lab without depending on external data sources.
# Uses `superset shell` (Flask shell with app context pre-loaded) rather
# than `python -c` to avoid the create_app()/app_context() boilerplate.
superset shell <<'PYEOF'
import sys
from superset.extensions import db