https://www.grammarly.com/blog/appositive/
When an appositive noun or noun phrase contains an essential element without which a sentence’s meaning would materially alter, do not frame it with commas.
My friend, Jenny, owes me fifty dollars. (wrong)
My friend Jenny owes me fifty dollars.
When the identifier makes sense in the sentence by itself, then the name is nonessential and you use a comma before it.
So what about these examples? Friend could be anybody so it makes sense to use the commas, but a husband and a partner identifies the subject, so I'd assume commas should be used around the names? We can assume they are only married to one person...so it is nonessential information.
1.Singer Ellie Goulding and her husband Caspar Jopling were seen leaving the Roundhouse in Camden, London,
2.He was dragged away by powerful currents during the evening swim at around 6pm, while his partner Jenny stayed in the hotel room.