STYLE: upgrade ruff
- [x] closes #52448 
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
There are still some errors. On the latest version of ruff, codes like 
```
match = (
            r"(No such file or directory|没有那个文件或目录|" r"File o directory non esistente)"
        )
```
will raises
```
ISC001 Implicitly concatenated string literals on one line
```
Meanwhile, if we just spilt the lines like
```
match = (
            r"(No such file or directory|没有那个文件或目录|" 
            r"File o directory non esistente)"
        )
```
It will be revised automatically by the black hook.