Drain ricotta in a sieve set over a bowl. Cover and chill overnight.
Squeeze excess moisture from spinach and mix with ricotta, Parmesan and egg in a bowl. Season with salt and pepper then stir in flour until mixture comes together to form a soft, sticky dough.
Divide dough in half and on a lightly floured surface, roll halves into a log shape about 40cm long. Cut logs into 2cm pieces. With lightly floured hands, roll pieces into oval shapes. Place on a baking parchment-lined tray.
Carefully drop the gnocchi, one by one, into a large pot of salted boiling water. When they rise to the surface, cook for another minute. Use a slotted spoon to remove gnocchi and transfer to a warmed plate with 30g of melted butter to stop them sticking. Keep warm.
Melt remaining butter in a frying pan over medium-high heat. Add walnuts and cook until the butter turns a nut-brown colour. Add sage leaves and lemon juice and stir.