Welcome to the community and thanks for your report. We will review it and answer to you here in this topic. But it can take some time.
Have a good day!
Here is a simpler example, the context manager isnt needed
# Sonarlint complains on this one
async def sample() -> AsyncIterator[int]:
yield 1
# Sonarlint is happy with this one, but it is wrong (mypy complains)
async def sample() -> Iterator[int]:
yield 1
Note both AsyncIterator and AsyncGenerator both cause the same Sonarlint error S5886, but Generator and Iterator seem to work, but it should not.
Until we deliver a fix for this FP, on SonarLint you could add a comment # NOSONAR to deactivate the single issue.
Otherwise, if the rule is generating too much noise in your project, you could also deactivate the rule under “SonarLint Rules” tab in VSCode.