Skip to content

Commit 4309001

Browse files
committed
Check the content of list.
1 parent 89d4d3e commit 4309001

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/pyspark/sql/dataframe.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,9 @@ def approxQuantile(self, cols, probabilities, relativeError):
11991199
if isinstance(cols, tuple):
12001200
cols = list(cols)
12011201
if isinstance(cols, list):
1202+
for c in cols:
1203+
if not isinstance(c, str):
1204+
raise ValueError("column name should be string.")
12021205
cols = _to_list(self._sc, cols)
12031206

12041207
if not isinstance(probabilities, (list, tuple)):

0 commit comments

Comments
 (0)