We have a PR https://github.com/apache/spark/pull/54840 aiming to replace black with ruff as the python formatter.
There are a few reasons to do that: 1. ruff is significantly faster than black - 30x according to their blog, 100x on spark repo per @LuciferYang's test. This makes the pre-commit hook more pleasant. 2. Since we already use ruff for linting, using it for formatting will reduce our development tool dependencies. 3. ruff has a slightly better taste than black in my opinion and is more customizable (if anyone's interested, feel free to check the PR to view the diff). This is also a good timing to upgrade because we just upgraded black version which caused a large refactoring. If we do this now, the two code refactoring will feel like one to most people, less interruption. Feedbacks are welcome! Tian
