While a raw diet is the most biologically-correct and beneficial diet for your pet, foods that contain these legumes in dry form are still a better alternative if you are on your way to transitioning to raw!
Remember that your pet needs the high protein & moisture content though, so if you choose these foods, make sure your pet has access to enough water throughout the day!