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



##########
File path: python/pyspark/pandas/namespace.py
##########
@@ -407,6 +410,20 @@ def read_csv(
         index_spark_column_names = []
         index_names = []
 
+    data_spark_columns = [scol_for(sdf, col) for col in column_labels.values()]
+    if thousands is not None:
+        if not isinstance(thousands, str) or len(thousands) != 1:
+            raise ValueError("Only length-1 comment characters supported")
+        new_data_spark_columns = list()
+        for scol in data_spark_columns:
+            scol_replaced = F.regexp_replace(scol, thousands, "")

Review comment:
       This isn't really correct. It assumes that the string representation of 
other types are same as the raw data but that's not the true.
   
   For example, it wouldn't work if you set `timestampFormat` to something like 
`yyyy-MM` and set `thousands` to `-`.




-- 
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.

To unsubscribe, e-mail: [email protected]

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