potiuk commented on code in PR #73179:
URL: https://github.com/apache/airflow/pull/73179#discussion_r4073003601
##########
airflow-core/src/airflow/cli/commands/info_command.py:
##########
@@ -119,6 +118,10 @@ def process_url(self, value) -> str:
netloc = host
else:
netloc = ""
+ else:
+ # A netloc-less URL is a local-file backend (SQLite is the
default), where
+ # the path itself is the identifying information.
+ return self.process_path(value)
Review Comment:
`nit` — the neighbouring fields hand `process_path` a bare filesystem path,
but here it also gets the scheme, so the unanchored substitution can chew on
the scheme itself:
```text
username "lite", sqlite:////home/lite/airflow.db ->
sq${USER}:///${HOME}/airflow.db
username "db", duckdb:////home/db/wh.duckdb ->
duck${USER}:///${HOME}/wh.duck${USER}
```
Splitting on the first colon keeps the scheme out of reach and is
byte-identical on every realistic input (checked against the Docker
`sqlite:////opt/${USER}/${USER}.db` case, `sqlite:///:memory:`, `sqlite://` and
the `NOT AVAILABLE` fallback):
```python
scheme, sep, rest = value.partition(":")
return f"{scheme}{sep}{self.process_path(rest)}"
```
Marginal — netloc-less schemes are `sqlite`, `duckdb` and `mssql+pyodbc`, so
it takes a username like `lite` or `db` to bite. Not blocking.
--
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]