When running ruff check --fix --unsafe-fixes (no extra settings or config) on the following code snippet:
foo_tooltip = (
lambda x, data: f"\nfoo: {data['foo'][int(x)]}"
if data["foo"] is not None
else ""
)
Ruff introduces a syntax error and reverts the fix.
The rule code to fix is E731:
test.py:1:1: E731 Do not assign a `lambda` expression, use a `def`