Dev-iL commented on code in PR #40069:
URL: https://github.com/apache/airflow/pull/40069#discussion_r1628924640
##########
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:
@uranusjr I applied your suggestion to `settings.py`, but couldn't use it to
similarly simplify the tests. It seems like the output of `isabs` for Windows
paths depends on the host OS:
Python 3.12 @ Windows:

---
Python 3.9 & 3.11 @ Linux

--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]