The Prophet ﷺ said, "If anybody has to take an oath, he should swear only by Allah." The people of Quraish used to swear by their fathers, but the Prophet ﷺ said, "Do not swear by your fathers. " (Using translation from Bukhārī 3836)
قَالَ رَسُولُ اللهِ ﷺ مَنْ كَانَ حَالِفًا فَلَا يَحْلِفُ إِلَّا بِاللهِ وَكَانَتْ قُرَيْشٌ تَحْلِفُ بِآبَائِهَا فَقَالَ «لَا تَحْلِفُوا بِآبَائِكُمْ»