uranusjr commented on code in PR #40069: URL: https://github.com/apache/airflow/pull/40069#discussion_r1628585916
########## airflow/settings.py: ########## @@ -278,17 +280,29 @@ def remove(*args, **kwargs): pass +def _is_sqlite_db_path_relative(sqla_conn_str: str) -> bool: + """Determine whether the database connection URI specifies an absolute path.""" + import re2 + + is_abs_win_prefix: bool = sys.platform == "win32" and bool( + re2.match(r"^sqlite:///" + _WINDOWS_ABSOLUTE_PATH_PREFIX, sqla_conn_str) + ) + is_abs_unix_prefix: bool = sqla_conn_str.startswith("sqlite:////") Review Comment: You can instead use `os.path.isabs` after removing the prefix. The platform check is also not necessary that way. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org