The Messenger of Allah ﷺ said, "There is no vow and no oath binding upon the son of Adam regarding what he does not possess, nor in disobedience to Allah, nor in severing ties of kinship. Whoever takes an oath and then sees something better than it, let him abandon his oath and do what is better, for abandoning it is its expiation."
قال رسول ﷺ: لا نذر، ولا يمين فيما لا يملك ابن آدم، في معصية الله، ولا في قطيعة رحم، ومن حلف على يمين فرأى غيرها خيرا منها فليدعها، وليأت الذي هو خير، فإن تركها كفارتها.
Abu Dawud (3274), Nasai (3792), Ahmad (6990), and Bayhaqi (10/33) all narrated it from the hadith of Ubaydullah bin Akhnas, from Amr bin Shuayb, from his father, from his grandfather, and he related it. Ibn Majah (2111) narrated it through another route, from Amr bin Shuayb, from his father, from his grandfather, except that Nasai did not mention his words, "and whoever swears an oath... if he leaves it, its expiation is [enough]." His words, "if he leaves it, its expiation is [enough]," contradict the sahih hadiths that require expiation upon breaking an oath, so at the very least it is anomalous.Abu Dawud said following it, "All the hadiths from the Prophet ﷺ say, 'let him make expiation for his oath,' and these are the sahih ones, except for what is not worth paying attention to."Abu Dawud said, "I said to Ahmad, 'Yahya bin Saeed narrated from Yahya bin Ubaydullah.' He said, 'He abandoned him after that, and he was qualified to do so.'" Ahmad said, "His hadiths are objectionable, and his father is unknown." End [of quote].As for the hadith of Yahya bin Ubaydullah, it is what Bayhaqi (10/34) narrated through his route from him, from his father, from Abu Hurairah, from the Prophet ﷺ, who said, "Whoever swears an oath and then sees something better than it, let him do what is better, and that is his expiation." Yahya bin Ubaydullah bin Abdullah bin Mawhab is very daif.To the same effect, it was also narrated from Ibn Abbas, Abu Saeed Khudri, and Ayesha, with daif chains of transmission.