It works if a run the code using a Notebook, but if I use a Spark Submit or Python Submit job it doesn't work