I wonder if you're pre-empting the user of this function a bit too much. They haven't asked you to validate the types of data, they've asked you to find the unique labels... But whatever validation you do needs documenting.