potiuk opened a new pull request, #72174:
URL: https://github.com/apache/airflow/pull/72174
The `account` and `region` connection fields are interpolated into the SQL
API URL, with the `.snowflakecomputing.com` suffix appended as text:
```python
url = f"{self.account_identifier}.snowflakecomputing.com/api/v2/statements"
```
Neither field was checked, so a value carrying URL-significant punctuation
changed the address the request was sent to rather than just naming the account.
Both are now restricted to the characters a Snowflake account or region
identifier is actually made of — letters, digits, `.`, `_` and `-` — and
anything else raises `ValueError` before a request is built. An empty
`account`, which previously produced a meaningless host, is rejected too.
**Test change worth flagging:** four `test_snowflake_sql_api` tests patched
`_get_conn_params` without setting a return value, so they were building their
URLs from a `MagicMock`. They now use the `CONN_PARAMS` constant the rest of
that file already uses.
Local: 386 passed, 11 skipped across the Snowflake provider; ruff and mypy
clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]