Sahih al-Bukhari, Book 65, Hadith 4822 (In-Book) ⓘ
Narrated `Abdullah: It is a sign of having knowledge that, when you do not know something, you say: 'Allah knows better.' Allah said to his Prophet: 'Say: No wage do I ask of you for this (Qur'an), nor am I one of the pretenders (a person who pretends things which do not exist)' (38.86) When the Quraish troubled and stood against the Prophet he said, "O Allah! Help me against them by afflicting them with seven years of famine like the seven years of Joseph." So they were stricken with a year of famine during which they ate bones and dead animals because of too much suffering, and one of them would see something like smoke between him and the sky because of hunger. Then they said: Our Lord! Remove the torment from us, really we are believers. (44.12) And then it was said to the Prophet (by Allah), "If we remove it from them. they will revert to their ways (of heathenism)." So the Prophet invoked his Lord, who removed the punishment from them, but later they reverted (to heathenism), whereupon Allah punished them on the day of the Battle of Badr, and that is what Allah's Statement indicates: 'Then watch for the day that the sky will bring forth a kind of smoke plainly visible...we will indeed (then) exact retribution.' (44.10).
حَدَّثَنَا يَحْيَى، حَدَّثَنَا وَكِيعٌ، عَنِ الأَعْمَشِ، عَنْ أَبِي الضُّحَى، عَنْ مَسْرُوقٍ، قَالَ دَخَلْتُ عَلَى عَبْدِ اللَّهِ فَقَالَ إِنَّ مِنَ الْعِلْمِ أَنْ تَقُولَ لِمَا لاَ تَعْلَمُ اللَّهُ أَعْلَمُ، إِنَّ اللَّهَ قَالَ لِنَبِيِّهِ صلى الله عليه وسلم {قُلْ مَا أَسْأَلُكُمْ عَلَيْهِ مِنْ أَجْرٍ وَمَا أَنَا مِنَ الْمُتَكَلِّفِينَ} إِنَّ قُرَيْشًا لَمَّا غَلَبُوا النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَاسْتَعْصَوْا عَلَيْهِ قَالَ اللَّهُمَّ أَعِنِّي عَلَيْهِمْ بِسَبْعٍ كَسَبْعِ يُوسُفَ فَأَخَذَتْهُمْ سَنَةٌ أَكَلُوا فِيهَا الْعِظَامَ وَالْمَيْتَةَ مِنْ الْجَهْدِ حَتَّى جَعَلَ أَحَدُهُمْ يَرَى مَا بَيْنَهُ وَبَيْنَ السَّمَاءِ كَهَيْئَةِ الدُّخَانِ مِنْ الْجُوعِ قَالُوا  رَبَّنَا اكْشِفْ عَنَّا الْعَذَابَ إِنَّا مُؤْمِنُونَ  فَقِيلَ لَهُ إِنْ كَشَفْنَا عَنْهُمْ عَادُوا فَدَعَا رَبَّهُ فَكَشَفَ عَنْهُمْ فَعَادُوا فَانْتَقَمَ اللَّهُ مِنْهُمْ يَوْمَ بَدْرٍ فَذَلِكَ قَوْلُهُ تَعَالَى  فَارْتَقِبْ يَوْمَ تَأْتِي السَّمَاءُ بِدُخَانٍ مُبِينٍ إِلَى قَوْلِهِ جَلَّ ذِكْرُهُ إِنَّا مُنْتَقِمُونَ.
also referenced under: Hadith 4822 (DarusSalam) & Volume 6, Book 60, Hadith 347 (USC-MSA)