This is an automated email from the ASF dual-hosted git repository.
dianfu pushed a commit to branch release-1.14
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.14 by this push:
new 07fc8c40f18 [FLINK-27776][python] Throw meaningful exceptions when
UDAF doesn't override method 'merge' is used in cases where 'merge' is used
07fc8c40f18 is described below
commit 07fc8c40f18ed86b6adfe420bcef83da5fd022e2
Author: huangxingbo <[email protected]>
AuthorDate: Wed May 25 21:05:36 2022 +0800
[FLINK-27776][python] Throw meaningful exceptions when UDAF doesn't
override method 'merge' is used in cases where 'merge' is used
This closes #19817.
---
flink-python/pyflink/table/udf.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/flink-python/pyflink/table/udf.py
b/flink-python/pyflink/table/udf.py
index f7d9b4ef2b5..5d38617bc03 100644
--- a/flink-python/pyflink/table/udf.py
+++ b/flink-python/pyflink/table/udf.py
@@ -164,7 +164,7 @@ class ImperativeAggregateFunction(UserDefinedFunction,
Generic[T, ACC]):
:param accumulator: the accumulator which contains the current
aggregated results
:param args: the input value (usually obtained from new arrived data).
"""
- pass
+ raise RuntimeError("Method retract is not implemented")
def merge(self, accumulator: ACC, accumulators):
"""
@@ -178,7 +178,7 @@ class ImperativeAggregateFunction(UserDefinedFunction,
Generic[T, ACC]):
custom merge method.
:param accumulators: a group of accumulators that will be merged.
"""
- pass
+ raise RuntimeError("Method merge is not implemented")
def get_result_type(self) -> DataType:
"""
@@ -187,7 +187,7 @@ class ImperativeAggregateFunction(UserDefinedFunction,
Generic[T, ACC]):
:return: The :class:`~pyflink.table.types.DataType` of the
AggregateFunction's result.
"""
- pass
+ raise RuntimeError("Method get_result_type is not implemented")
def get_accumulator_type(self) -> DataType:
"""
@@ -196,7 +196,7 @@ class ImperativeAggregateFunction(UserDefinedFunction,
Generic[T, ACC]):
:return: The :class:`~pyflink.table.types.DataType` of the
AggregateFunction's accumulator.
"""
- pass
+ raise RuntimeError("Method get_accumulator_type is not implemented")
class AggregateFunction(ImperativeAggregateFunction):