CI: flake8 check does not work properly
xref #37938

Have seen it in #37923 and in #37703 , so ci checks ran successfully in those feature PRs, but actually they should have detected this unused import.

Basically flake8 check in CI should detect cases such as `unused imports`, however, right now, observed from those two PRs, it didn't detect them in feature PRs and then resulted in CI failure on master