Leaving the dishwasher on while leaving the house is generally safe as long as the dishwasher is functioning properly.
However after I had a bad experience with flooding of the kitchen while away from home with my dishwasher on I no longer leave the dishwasher on while gone away from the house longer than 10 minutes.
Once I left for work and left the dishwasher on and when I came back to the house my kitchen was flooded because the water didn't shut off to the dishwasher because the water valve inside which activates with a switch and float didn't work properly and got stuck on allowing the water to continue to fill the dishwasher.
This shouldn't be a problem with a new dishwasher but still anything can happen and I personally would never leave a dishwasher on while away from home or when sleeping either.