2010 MINI Cooper Convertible - CEL

My Mini Cooper’s check engine light came on right after I bought it, used at 126,000 miles. It turned off and then continued to turn on after a while. I took it to a mechanic and he said we needed to change the O2 sensor which he did. After driving it for another 60+ miles it came on and then turned off after a while again. I took it back anyway because I want to make sure it’ll pass the smog check, but he said the code said pending and thus he would need more time to look at it. Does anyone have any idea what else it could be?

Until a code can be retrieved, I don’t know what could be done. A MINI dealership might have a more sophisticated system to retrieve the code.
If the light is currently on, I would bite the bullet and pay the diagnostic fee.