Mix both flours, polenta, thyme, sugar, salt, pepper and oil in a large bowl. Add the butter and stir in lightly mashing each cube between your fingers. Add water and collect the dough with your hands – it will be quite sticky. Transfer to a well-floured work surface and knead a little more. Shape the dough into a circle, wrap tightly with plastic wrap and place in the fridge for 30 minutes.
In a small bowl, mix the ricotta, gruyere, parmesan, pinch of salt, pepper to taste and lemon zest and set aside.
Cut the asparagus at an angle, pour over the olive oil, add salt, lemon zest and pepper.
Roll out the crust dough and roll out the dough into a large round shape, about 14 centimeters wide, on floured greaseproof paper. Arrange the ricotta mixture in the middle, leaving a 4cm edge blank. Spoon the asparagus over the ricotta layer. Fold the border over the filling.
For a darker, shinier crust, beat the egg with 1 teaspoon of water and coat the dough.
Bake the galette at 200 degrees, 30 to 35 minutes, until the crust is deep golden.