This is an automated email from the ASF dual-hosted git repository.

hxb pushed a commit to branch release-1.15
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.15 by this push:
     new 4035d61a275 [FLINK-30637][python] Replace 'is' with '==' to fix 
potential match issues with OverWindow Aggregation On Linux-arch64
4035d61a275 is described below

commit 4035d61a2756ec16046fb687f533be0501fbbd35
Author: YasuoStudyJava <119689582+yasuostudyj...@users.noreply.github.com>
AuthorDate: Wed Jan 11 22:41:42 2023 +0800

    [FLINK-30637][python] Replace 'is' with '==' to fix potential match issues 
with OverWindow Aggregation On Linux-arch64
    
    This closes #21649.
---
 flink-python/pyflink/fn_execution/table/operations.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/flink-python/pyflink/fn_execution/table/operations.py 
b/flink-python/pyflink/fn_execution/table/operations.py
index 8dc2485c1f3..8c3ab36f84f 100644
--- a/flink-python/pyflink/fn_execution/table/operations.py
+++ b/flink-python/pyflink/fn_execution/table/operations.py
@@ -180,9 +180,9 @@ class 
PandasBatchOverWindowAggregateFunctionOperation(BaseOperation):
         bounded_range_window_nums = 0
         for i, window in enumerate(self.windows):
             window_type = window.window_type
-            if (window_type is window_types.RANGE_UNBOUNDED_PRECEDING) or (
-                    window_type is window_types.RANGE_UNBOUNDED_FOLLOWING) or (
-                    window_type is window_types.RANGE_SLIDING):
+            if (window_type == window_types.RANGE_UNBOUNDED_PRECEDING) or (
+                    window_type == window_types.RANGE_UNBOUNDED_FOLLOWING) or (
+                    window_type == window_types.RANGE_SLIDING):
                 self.bounded_range_window_index[i] = bounded_range_window_nums
                 self.is_bounded_range_window.append(True)
                 bounded_range_window_nums += 1
@@ -221,13 +221,13 @@ class 
PandasBatchOverWindowAggregateFunctionOperation(BaseOperation):
             if self.is_bounded_range_window[window_index]:
                 window_boundaries = boundaries_series[
                     self.bounded_range_window_index[window_index]]
-                if window_type is OverWindow.RANGE_UNBOUNDED_PRECEDING:
+                if window_type == OverWindow.RANGE_UNBOUNDED_PRECEDING:
                     # range unbounded preceding window
                     for j in range(input_cnt):
                         end = window_boundaries[j]
                         series_slices = [s.iloc[:end] for s in input_series]
                         result.append(func(series_slices))
-                elif window_type is OverWindow.RANGE_UNBOUNDED_FOLLOWING:
+                elif window_type == OverWindow.RANGE_UNBOUNDED_FOLLOWING:
                     # range unbounded following window
                     for j in range(input_cnt):
                         start = window_boundaries[j]
@@ -242,19 +242,19 @@ class 
PandasBatchOverWindowAggregateFunctionOperation(BaseOperation):
                         result.append(func(series_slices))
             else:
                 # unbounded range window or unbounded row window
-                if (window_type is OverWindow.RANGE_UNBOUNDED) or (
-                        window_type is OverWindow.ROW_UNBOUNDED):
+                if (window_type == OverWindow.RANGE_UNBOUNDED) or (
+                        window_type == OverWindow.ROW_UNBOUNDED):
                     series_slices = [s.iloc[:] for s in input_series]
                     func_result = func(series_slices)
                     result = [func_result for _ in range(input_cnt)]
-                elif window_type is OverWindow.ROW_UNBOUNDED_PRECEDING:
+                elif window_type == OverWindow.ROW_UNBOUNDED_PRECEDING:
                     # row unbounded preceding window
                     window_end = window.upper_boundary
                     for j in range(input_cnt):
                         end = min(j + window_end + 1, input_cnt)
                         series_slices = [s.iloc[: end] for s in input_series]
                         result.append(func(series_slices))
-                elif window_type is OverWindow.ROW_UNBOUNDED_FOLLOWING:
+                elif window_type == OverWindow.ROW_UNBOUNDED_FOLLOWING:
                     # row unbounded following window
                     window_start = window.lower_boundary
                     for j in range(input_cnt):

Reply via email to