Chop the pistachios with a knife and set aside. Chop the white onion and celery and fry in a little oil. Add the pistachios and the datterini tomatoes and cook until the sauce has curdled. Add salt and turn off the heat. In another saucepan, cook the red onion rings with the cubes of pumpkin flesh. Bring to boil, add salt, season with freshly ground black pepper and turn off the heat. In a large pot, bring to a boil the water, add salt and cook the spaghetti. Meanwhile reduce the pumpkin cream: put it back on the heat, adding a little 'cooking water to make it smooth, add a part of the pistachio sauce. Mix well and add the spaghetti “al dente”. Add a few tablespoons of the cooking water again, stir the sauce and serve hot with a generous sprinkling of pecorino cheese.
Recipe from the blog "Con le mani in pasta"