You are extremely lucky that the file wasn’t a part of some other package. Next time, before you delete anything, check with pacman -Qo <file_name> first.
But in this case, it’s okay because the directory you deleted is a __pycache__ directory, which contains bytecodes that are generated by python—those bytecodes could be generated again, so there’s no problem there.