Yes. Shotgun pellets lose effective velocity within a relatively short distance. Shoot into the air, and by the time they come down they are pretty much harmless.
Birdshot, yes. Buckshot or slugs, though...absolutely not.
And to the larger point, you should never shoot warning shots.
https://www.thetruthaboutguns.com/2018/10/john-boch/personal-defense-tip-just-say-no-to-warning-shots/warning-shot-770/