HyukjinKwon commented on a change in pull request #30985:
URL: https://github.com/apache/spark/pull/30985#discussion_r558342085



##########
File path: python/pyspark/worker.py
##########
@@ -500,7 +501,10 @@ def main(infile, outfile):
 
             except (resource.error, OSError, ValueError) as e:
                 # not all systems support resource limits, so warn instead of 
failing
-                print("WARN: Failed to set memory limit: {0}\n".format(e), 
file=sys.stderr)
+                warnings.warn(
+                    "Failed to set memory limit: {0}\n".format(e),
+                    ResourceWarning
+                )

Review comment:
       That sounds fine if it works though we will have to manually test it 
out. I am fine either way (reverting it or fixing as avoid after manually 
testing). We could also use 
[formatwarning](https://docs.python.org/3/library/warnings.html#warnings.formatwarning)
 that will also obviously work. Maybe you could get the file number via, for 
example, `inspect.getframeinfo(inspect.currentframe()).lineno` too.
   
   I am okay either way if it works.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to