diff --git a/python/pyspark/testing/pandasutils.py b/python/pyspark/testing/pandasutils.py index 6d402985f4ae..a5b913ec6727 100644 --- a/python/pyspark/testing/pandasutils.py +++ b/python/pyspark/testing/pandasutils.py @@ -259,7 +259,7 @@ def temp_dir(self): @contextmanager def temp_file(self): with self.temp_dir() as tmp: - yield tempfile.mktemp(dir=tmp) + yield tempfile.mkstemp(dir=tmp)[1] class ComparisonTestBase(PandasOnSparkTestCase):