CI upgrade pyupgrade
Issue here is:

1. in `.pre-commit-config.yaml`, change the `ref` of `pyupgrade` from v2.7.4 to v2.9.0
2. run `pre-commit run pyupgrade --all-files`
3. run `pre-commit run flake8 --all-files` - there will be lots of errors from unused imports, so you should remove them (or you could look into using [autoflake](https://github.com/myint/autoflake) to do it for you)
4. if both `pre-commit run flake8 --all-files` and `pre-commit run pyupgrade --all-files` both pass, then open a pull request :rocket: 

---

xref #39521