The Mālikī scholar, al-Imām al-Ḥāfiẓ Abī ʿUmar Yūsuf b. ʿAbd al-Barr al-Andalusī (d.463H) brings in his book, al-Inqitāʾ
Transmitted to Khalf b. Qāsim who said transmitted to us Abū al-Ṭāhir Muḥammad b. Aḥmad b. Yaḥyā al-Qāḍhī of Miṣr who said transmitted to us Jaʿfar b. Muḥammad al-Firyābī who said transmitted to us Ibrāhīm b. al-Mundhir who said transmitted to us Maʿn b. ʿIsā and Muḥammad b. Sadaqah who said that Mālik b. Anas said:
“Seek and take knowledge from other than the following four type of people:
(1) The Safīh (Silly, foolish, stupid, obscene, vulgar [take your pick]).
(2) The person of desires who calls to his innovation.
(3) The person who lies in the affair of people even though he is not accused of lying in the Ḥadīth of the Messenger of Allāh Sallalahu Alayhi Wasallam.
(4) A Shaykh with virtue, excellence and worship but lacks the understanding of what he receives and transmit of knowledge.”
Imam Ibn ʿAbd al-Barr, al-Inqitāʾ Fī Faḍhāʾil al-Aʾimah al-Thalātha al-Fuqahāʾ: Mālik b. Anas, Muḥammad Idrīs al-Shāfiʿī wa Abī Hanīfah al-Nuʿmān, 46, (Beirut: Dār al-Bashāʾir al-Islamiyyah, 1431/2010) Edn. 2nd, under the supervision of ʿAbd al-Fattāḥ Abū Ghuddah.