Timm0 commented on code in PR #30053:
URL: https://github.com/apache/flink/pull/30053#discussion_r4683782537


##########
flink-python/pyflink/table/tests/test_partitioned_table.py:
##########
@@ -0,0 +1,89 @@
+################################################################################
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+from pyflink.table.expressions import col, map_
+from pyflink.testing.test_case_utils import PyFlinkStreamTableTestCase
+
+
+class PartitionedTableTests(PyFlinkStreamTableTestCase):
+    """
+    Tests built-in process table function calls through the Python Table API.
+    """
+
+    def test_partition_by_to_changelog(self):
+        table = self.t_env.from_elements([(1, "a"), (2, "b")], ["id", "name"])
+
+        result = table.partition_by(col("id")).to_changelog()
+
+        rows = [tuple(row) for row in result.execute().collect()]
+        self.assert_equals(rows, [(1, "INSERT", "a"), (2, "INSERT", "b")])

Review Comment:
   The `[partition_keys, op, ...]` reordering is covered on the Java side by 
`ToChangelogTestPrograms.TABLE_API_RETRACT_PARTITION_BY`, which partitions on a 
middle column through `PartitionedTable.toChangelog()`. In the Python tests I 
would rather put focus on checking that PyFlink calls the right Java methods, 
not to retest every case of the function's behaviour through another API. 
Therefore I would keep `id` here to mirror the docstring example. Please let me 
know if that works for you, or if you have any concern here.



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