It is recommended to clean the beans the day before and let them soak overnight. Alternatively, you can use 600 g canned beans, eliminating the need for overnight soaking.
After draining and rinsing the beans thoroughly, boil them in a covered pot with plenty of unsalted water for approximately one and a half hours. During cooking, a foam may form, which should be removed with a slotted spoon to ensure clearer pasta and beans.
Finely chop the carrots, celery and onion.
In a large pot, heat 2–3 tablespoons of olive oil. Add celery, carrots, and onion, and sauté over medium heat until the vegetables are tender (about 5 minutes).
Stir in the tomato sauce, reduce the heat, and cook for 5 minutes.
Once the beans are cooked, puree about half of them using an immersion blender (or use a food mill) to create a creamy consistency. Pour the beans and their liquid into the pot with the vegetables, season with salt and pepper to taste, add a sprig of rosemary, and cover. Simmer for approximately 15 minutes, stirring occasionally.
Add the pasta and continue cooking until it reaches the desired level of cooking (al dente). If the liquid reduces too much, you can add a small amount of boiling water.
Serve the pasta and beans with a drizzle of olive oil, and if desired, sprinkle with pepper and parmesan cheese.