The Prophet ﷺ said, "Do not swear by your fathers, nor by false idols."
أخبرنا أحمد بن سليمان قال حدثنا يزيد قال أنبأنا هشام عن الحسن
عن النبي ﷺ قال لا تحلفوا بآبائكم ولا بالطواغيت
Muslim narrated it, in the Book of Faith, chapter on one who swears by Lat or Uzza should say, "There is no god but Allah," hadith 1648, from the hadith of Hisham bin Hassan, with the same wording. It is also found in Kubra, hadith 4715.Yazid is Ibn Harun.