HyukjinKwon commented on a change in pull request #33907:
URL: https://github.com/apache/spark/pull/33907#discussion_r702591184
##########
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, "")
+ cond = F.when(scol_replaced.isNull(),
np.nan).otherwise(scol_replaced.cast("float"))
+ if len(sdf.select(cond).filter(cond.isNull()).head(1)) == 0:
Review comment:
can we avoid launching jobs for every column?
--
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]