Srimad-Bhagavatam: Canto 9 - Chapter 1 - Verse 22
यदिदं कूपमग्नाया भवतो दर्शनं मम ।न ब्राह्मणो मे भविता हस्तग्राहो महाभुज ।कचस्य बार्हस्पत्यस्य शापाद् यमशपं पुरा ॥ २२ ॥
yad idaṁ kūpa-magnāyābhavato darśanaṁ mamana brāhmaṇo me bhavitāhasta-grāho mahā-bhujakacasya bārhaspatyasyaśāpād yam aśapaṁ purā
Because of falling in the well, I met you. Indeed, this has been arranged by providence. After I cursed Kaca, the son of the learned scholar Bṛhaspati, he cursed me by saying that I would not have a brāhmaṇa for a husband. Therefore, O mighty-armed one, there is no possibility of my becoming the wife of a brāhmaṇa.
Kaca, the son of the learned celestial priest Bṛhaspati, had been a student of Śukrācārya, from whom he had learned the art of reviving a man who has died untimely. This art, called mṛta-sañjīvanī, was especially used during wartime. When there was a war, soldiers would certainly die untimely, but if a soldier’s body was intact, he could be brought to life again by this art of mṛta-sañjīvanī. This art was known to Śukrācārya and many others, and Kaca, the son of Bṛhaspati, became Śukrācārya’s student to learn it. Devayānī desired to have Kaca as her husband, but Kaca, out of regard for Śukrācārya, looked upon the guru’s daughter as a respectable superior and therefore refused to marry her. Devayānī angrily cursed Kaca by saying that although he had learned the art of mṛta-sañjīvanī from her father, it would be useless. When cursed in this way, Kaca retaliated by cursing Devayānī never to have a husband who was a brāhmaṇa. Because Devayānī liked Yayāti, who was a kṣatriya, she requested him to accept her as his bona fide wife. Although this would be pratiloma-vivāha, a marriage between the daughter of a high family and the son of a lower family, she explained that this arrangement was made by providence.