La Compañía is a Chilean town in the communes of Graneros and Codegua in Cachapoal Province, O'Higgins Region.