potiuk commented on PR #70899:
URL: https://github.com/apache/airflow/pull/70899#issuecomment-5151544083
CI fixed, and the fix reaches beyond this PR — **the Amazon tests already on
`main` were failing the same way**, so this now repairs those too.
The failures were `Compat 2.11.1:P3.10` and `Compat 3.0.6:P3.10`, all three
backends, `assert 0 == 1`. Cause: the assertions read `record.msg` directly,
and how a record carries its payload depends on the Airflow version.
```python
# main — structlog renders the args before the stdlib record exists
LogRecord(msg="Connection id 'prod--x' contains '--'", args=())
"prod--x" in r.msg -> True
# compat targets — plain stdlib logging keeps the template
LogRecord(msg="%s id %r contains %r", args=("Connection", "prod--x", "--"))
"prod--x" in r.msg -> False <- the failure
"prod--x" in r.getMessage() -> True
```
`getMessage()` renders in both shapes, so the assertion is now
version-portable. It still targets the refused **id** rather than the wording,
which was the point of moving off the rendered sentence in the first place.
This is my own regression: I switched those assertions from `getMessage()`
to `msg` in #70878 while addressing @shahar1's review, verified only against
`main`, and merged. Compat runs on provider PRs, so it surfaced on the next
provider PR rather than on the one that introduced it.
--
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]