After upgrading Pandas from 1.1.5 to 1.2.x .transform stops working on empty DataFrames.
.transform
Some things that could be done to avoid the issue, but it will be to