CI: update pyupgrade to 2.7.4 in pre-commit
Updating pyupgrade to 2.7.4 in pre-commit yaml. `pre-commit run pyupgrade --all-files` runs good :+1: 

- [x] closes #37891
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
- [x] passes `pre-commit run pyupgrade --all-files`
