Put flour into a wide shallow dish. Heat 1 cup of the canola oil in a small pot over medium heat until it registers 325° on a deep-fry thermometer. Working in 2 batches, toss shallot rings in flour to coat and shake off any excess. Fry shallots, stirring gently, until golden brown, about 1½ minutes. Using a slotted spoon, transfer fried shallots to a paper towel–lined plate to let drain. Set shallot rings aside.
Heat remaining 2 tbsp. canola oil in a large skillet over medium heat. Add chopped shallots and cook just until beginning to caramelize, 3–4 minutes. Add butter, vinegar, and 1 cup water; cook until reduced by about one-third, 18–20 minutes.
Meanwhile, bring a large pot of salted water to a boil. Add parsley stems and cook for 10 seconds. Transfer stems to a colander in the sink and rinse under cold water. Add spaghetti to boiling water and cook until al dente, 8–10 minutes. Drain spaghetti and add to skillet with shallot reduction; toss to combine. Add cooked parsley stems, ricotta, olive oil, and salt and pepper to taste and toss to combine. Divide spaghetti among four warm bowls. Garnish with minced parsley, cilantro shoots, if using, and fried shallot rings. Serve immediately.