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:
   
![image](https://github.com/apache/airflow/assets/6509619/fbd59682-3bf1-4b5e-aa7f-22d2273a9eb6)
   
   ---
   Python 3.9 & 3.11 @ Linux
   
![image](https://github.com/apache/airflow/assets/6509619/2fdc8268-160f-4226-b0e9-4f3a90a48a86)
   



-- 
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

Reply via email to