You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "harupy (via GitHub)" <gi...@apache.org> on 2023/09/12 11:03:34 UTC

[GitHub] [spark] harupy commented on a diff in pull request #42887: [SPARK-45130][CONNECT][ML][PYTHON] Avoid Spark connect ML model to change input pandas dataframe

harupy commented on code in PR #42887:
URL: https://github.com/apache/spark/pull/42887#discussion_r1322872817


##########
python/pyspark/ml/tests/connect/test_legacy_mode_feature.py:
##########
@@ -57,7 +57,10 @@ def test_max_abs_scaler(self):
 
         local_df1 = df1.toPandas()
         local_fit_model = scaler.fit(local_df1)
+        input_cols = local_df1.columns.tolist()
         local_transform_result = local_fit_model.transform(local_df1)
+        assert local_df1.columns.tolist() == input_cols, \
+            "pandas dataframe input columns should be intact."

Review Comment:
   ```suggestion
           input_cols = local_df1.columns.copy()
           local_transform_result = local_fit_model.transform(local_df1)
           assert local_df1.columns.equals(input_cols), \
               "pandas dataframe input columns should be intact."
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org