Maybe raising ValueError when it's going to do nothing does make the most sense (along with a test for it). However not sure if we should backport something like that to 3.x as the current behavior is to swallow unsupported types and raising an exception might be breaking change.
Originally posted by @bdraco in #10101 (comment)