once you bought the pylon, it will work, as long as there are two, or more town NPCs (town pets also count) nearby. Regardless which NPCs those are, and regardless if they're happy or not.
by the way, there are many possible combinations, some obvious ones are like Mechanic + Goblin in snow, but that can be only achieved post-Skeletron.
the merchant focused combo can be achieved very early game too, so getting any/all pylons up (except for hallow) pre-bosses is quite possible using the merchant. I'm just assuming this doesn't works for the desert, because the merchant hates the desert. But the desert pylon is one of the easiest to get anyway.