dianfu commented on code in PR #29002:
URL: https://github.com/apache/flink/pull/29002#discussion_r3831359012


##########
flink-python/pyflink/dataframe/tests/test_dataframe.py:
##########
@@ -1080,28 +1304,40 @@ def test_basic_functionality(self):
                 lambda current: current["age"] + 1,
             )
             .with_column("age", pf.col("age") + 1)
-            .select(
-                "id",
-                "name",
-                "age",
-                age_next_year=pf.col("age_next_year"),
-                inferred_int=pf.lit(2),
-                inferred_string=pf.lit("x"),
-                explicit_int=pf.lit(3, pf.DataType.int64()),
-                explicit_large_int=pf.lit(1 << 40, pf.DataType.int64()),
-                explicit_string=pf.lit("y", pf.DataType.string()),
-                null_int=pf.lit(None, pf.DataType.int64()),
-                null_string=pf.lit(None, pf.DataType.string()),
-                non_nullable_int=pf.lit(
-                    3,
-                    pf.DataType(TableDataTypes.BIGINT().not_null()),
-                ),
+            .with_columns(
+                (pf.col("age_next_year") + 1).alias("age_in_two_years"),
+                score_percent=pf.col("score") * 100,
+            )
+            .drop("score", "city", "destination")
+            .rename({"name": "customer_name"})
+            .pipe(

Review Comment:
   I think we can call `.select` directly. `pipe` is already welled tested in 
test_pipe_forwards_dataframe_arguments_and_return_value. 



##########
flink-python/pyflink/dataframe/tests/test_dataframe.py:
##########
@@ -1114,9 +1350,46 @@ def test_basic_functionality(self):
             ]
         )
 
+        self.assertEqual(
+            result.columns,
+            [
+                "customer_name",
+                "id",
+                "age",
+                "age_next_year",
+                "age_in_two_years",
+                "score_percent",
+                "inferred_int",
+                "inferred_string",
+                "explicit_int",
+                "explicit_large_int",
+                "explicit_string",
+                "null_int",
+                "null_string",
+                "non_nullable_int",
+            ],
+        )
+        self.assertEqual(result.schema.get_field_names(), result.columns)

Review Comment:
   It's not that necessary to validate this any more in IT case. It's already 
covered in test_schema_exposes_ordered_metadata and 
test_columns_returns_defensive_ordered_list



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

Reply via email to