From f786d3d4dd26ea22dd5f636496c4f07e04c3d40f Mon Sep 17 00:00:00 2001 From: Daniel Standish <15932138+dstandish@users.noreply.github.com> Date: Mon, 23 Mar 2026 20:16:03 -0700 Subject: [PATCH] =?UTF-8?q?Speed=20up=20'Generate=20the=20FastAPI=20API=20?= =?UTF-8?q?spec'=20prek=20hook=20(~2min=20=E2=86=92=20~25s)=20(#64131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OpenAPI spec generation doesn't query the database — it only introspects FastAPI routes. Using postgres backend was adding ~90s of postgres container startup and migration overhead for no reason. Switching to sqlite cuts the hook from ~2 minutes to ~25 seconds. (cherry picked from commit 5d9819fea584df846a8f89d57d1b7137cd3b5ae4) --- scripts/ci/prek/generate_openapi_spec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/prek/generate_openapi_spec.py b/scripts/ci/prek/generate_openapi_spec.py index b6ddcb64aed79..b2d4d86df41d9 100755 --- a/scripts/ci/prek/generate_openapi_spec.py +++ b/scripts/ci/prek/generate_openapi_spec.py @@ -33,7 +33,7 @@ cmd_result = run_command_via_breeze_shell( ["python3", "/opt/airflow/scripts/in_container/run_generate_openapi_spec.py"], - backend="postgres", + backend="sqlite", skip_environment_initialization=False, )