This is an automated email from the ASF dual-hosted git repository.
jasonliu pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new a10b2c66aa9 [v3-1-test] Speed up 'Generate the FastAPI API spec' prek
hook (~2min → ~25s) (#64131) (#64132)
a10b2c66aa9 is described below
commit a10b2c66aa950410cb574a872a568b6fbf7665b6
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Mar 24 11:27:26 2026 +0800
[v3-1-test] Speed up 'Generate the FastAPI API spec' prek hook (~2min →
~25s) (#64131) (#64132)
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)
Co-authored-by: Daniel Standish
<[email protected]>
---
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 be28facec19..b7d66f16ed3 100755
--- a/scripts/ci/prek/generate_openapi_spec.py
+++ b/scripts/ci/prek/generate_openapi_spec.py
@@ -37,7 +37,7 @@ initialize_breeze_prek(__name__, __file__)
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,
)