Bring a large pot of salted water to a boil.
Add the chopped cabbage and cook for about 3 minutes, until just tender. Use a slotted spoon to remove the cabbage from the water, drain it, and set it aside.
Return the water to a boil, add the pasta, and cook according to package directions until al dente, about 7-10 minutes.
Drain the pasta well.
While the pasta cooks, heat the olive oil or melt the butter in a large skillet over medium heat.
Add the sliced leeks and celery and cook, stirring occasionally, until softened, about 5 minutes.
Add the thyme sprigs and the white wine, if using.
Cook for another minute, scraping up any bits from the bottom of the pan, until the wine has nearly evaporated.
Stir in the vegetable stock, drained beans, and the reserved cooked cabbage.
Season with a sprinkle of salt and pepper.
Bring to a simmer and cook for about 5 minutes to allow the flavors to meld and everything to heat through.
Add the drained pasta to the skillet with the bean and cabbage mixture.
Stir gently to combine everything.
Taste and adjust the seasoning if needed.
Serve immediately, garnished with a generous sprinkle of freshly grated Parmesan cheese.