Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20894#discussion_r188543599
--- Diff: python/pyspark/sql/tests.py ---
@@ -3040,6 +3040,22 @@ def test_csv_sampling_ratio(self):
.csv(rdd, samplingRatio=0.5).schema
self.assertEquals(schema, StructType([StructField("_c0",
IntegerType(), True)]))
+ def test_checking_csv_header(self):
+ tmpPath = tempfile.mkdtemp()
+ shutil.rmtree(tmpPath)
+ self.spark.createDataFrame([[1, 1000], [2000, 2]]).\
+ toDF('f1', 'f2').write.option("header", "true").csv(tmpPath)
--- End diff --
-> `.toDF('f1', 'f2') ...`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]