We recently sold a CA rental property and while there were many factors, CA's rental laws and requirements were one factor.
It caries by jurisdiction, but in ours, we would have had to pay twice the monthly rent (IIRC) just to end the rental. That's not in order to break the lease. That's just to say, "hey, I want to sell this property [or move in myself, or have my family member move in, or any other reason you won't continue renting it to the current tenant]." That's even if they don't have a lease and are month to month. We'd have had to pay that. We lucked out and when we let them know we'd be selling, they found another place so they could be sure to stay in the same school district and gave us notice. Since they moved out, rather than us booting them, we didn't have to pay.
IDK if this applies to lodgers or just tenants. And if I remember correctly, CA only requires 1 month of "displacement" compensation, but our county added a second for good measure, so check your specific locality.
This is an example of why I think landlording in CA is becoming a fools errand, especially when you compare rent rates to what you can get for selling. (Our townhouse sold for just over $900k. we probably could have rented for about $3900. Thats about .4%, or absolute crap in terms of rental properties. We'd owned it a long time so we were making money, but the opportunity cost of that $900k was far more than we were making. When you add the risks--the general risks of landlord, the extra risks thanks to CA's tenant-friendly rules, the increasing insurance costs, the risk of natrual and semi-natural disasters--well, I breathed a huge sigh of relief the day we closed escrow.