zhengruifeng commented on code in PR #38723: URL: https://github.com/apache/spark/pull/38723#discussion_r1029949413
########## python/pyspark/sql/tests/connect/test_connect_basic.py: ########## @@ -302,6 +301,31 @@ def test_to_pandas(self): self.spark.sql(query).toPandas(), ) + def test_select_expr(self): + # SPARK-41201: test selectExpr API. + self.assert_eq( + self.connect.read.table(self.tbl_name).selectExpr("id * 2").toPandas(), + self.spark.read.table(self.tbl_name).selectExpr("id * 2").toPandas(), + ) + self.assert_eq( + self.connect.read.table(self.tbl_name) + .selectExpr(["id * 2", "cast(name as long) as name"]) + .toPandas(), + self.spark.read.table(self.tbl_name) + .selectExpr(["id * 2", "cast(name as long) as name"]) + .toPandas(), + ) + + self.assert_eq( + self.connect.read.table(self.tbl_name) + .selectExpr("id * 2", "cast(name as long) as name") + .toPandas(), + self.spark.read.table(self.tbl_name) + .selectExpr("id * 2", "cast(name as long) as name") + .toPandas(), + ) + + @unittest.skip("test_fill_na is flaky") Review Comment: @amaliujia why you disable this test again? -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org