title: How to ignore spark-submit warnings for pyspark
body: <p>When I submit my python file to spark like this </p>
  
  <pre><code>spark-submit driver.py
  </code></pre>
  
  <p>It starts showing a lot of warning related to python 2 print method.</p>
  
  <pre><code>18/10/19 01:37:52 WARN ScriptBasedMapping: Exception running /etc/hadoop/conf/topology_script.py 10.5.1.112
  ExitCodeException exitCode=1:   File "/etc/hadoop/conf/topology_script.py", line 63
      print rack
               ^
  SyntaxError: Missing parentheses in call to 'print'. Did you mean print(rack)?
  </code></pre>
  
  <p>Is there any way like <code>spark-submit driver.py -W ignore</code> ??</p>
  
  <p><strong>>></strong> I know this is the warning of python2, my code is in python3 so I just want to ignore the python2 warnings. These warnings start showing even before control goes to my code. Because <code>spark-submit</code> runs first and later on load python files. </p>