Skip to content

Commit fea9df8

Browse files
committed
Make path seq if it is an string
1 parent 9ca920b commit fea9df8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/pyspark/sql/readwriter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,12 @@ def csv(self, paths):
242242
243243
:param paths: string, or list of strings, for input path(s).
244244
245-
>>> df = sqlContext.read.csv('python/test_support/sql/ages.csv')
245+
>>> df = sqlContext.read.option("inferSchema", "true").csv('python/test_support/sql/ages.csv')
246246
>>> df.dtypes
247-
[('C0', 'string'), ('C1', 'bigint')]
247+
[('C0', 'string'), ('C1', 'int')]
248248
"""
249+
if isinstance(paths, basestring):
250+
paths = [paths]
249251
return self._df(self._jreader.csv(self._sqlContext._sc._jvm.PythonUtils.toSeq(paths)))
250252

251253
@since(1.5)

0 commit comments

Comments
 (0)