You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2021/11/03 21:30:06 UTC
[airflow] 07/17: sqlite_default has been hard-coded to /tmp,
usegettempdir instead, (#19255)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit d291f76e39ad1441e26c045dbdabaa0900fefb9f
Author: Amit Ran <89...@users.noreply.github.com>
AuthorDate: Thu Oct 28 01:12:35 2021 +0300
sqlite_default has been hard-coded to /tmp, usegettempdir instead, (#19255)
respecting tempdir enviroment variables.
See #19208, #19229.
(cherry picked from commit bce888306f28d0c56c6a45c874a045fa304c90b7)
---
airflow/utils/db.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/airflow/utils/db.py b/airflow/utils/db.py
index 17522d3..2da0722 100644
--- a/airflow/utils/db.py
+++ b/airflow/utils/db.py
@@ -18,6 +18,7 @@
import logging
import os
import time
+from tempfile import gettempdir
from typing import Iterable
from sqlalchemy import Table, exc, func, inspect, or_, text
@@ -508,7 +509,7 @@ def create_default_connections(session=None):
Connection(
conn_id="sqlite_default",
conn_type="sqlite",
- host="/tmp/sqlite_default.db",
+ host=os.path.join(gettempdir(), "sqlite_default.db"),
),
session,
)