You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by di...@apache.org on 2024/05/11 02:56:22 UTC

(flink) branch release-1.19 updated: [FLINK-35112][python] Correct contains check for Row type (#24756)

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

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


The following commit(s) were added to refs/heads/release-1.19 by this push:
     new d16b20e4fb4 [FLINK-35112][python] Correct contains check for Row type (#24756)
d16b20e4fb4 is described below

commit d16b20e4fb4fb906927188ca11af599edd0953c1
Author: Wouter Zorgdrager <zo...@gmail.com>
AuthorDate: Sat May 11 04:53:19 2024 +0200

    [FLINK-35112][python] Correct contains check for Row type (#24756)
---
 flink-python/pyflink/common/types.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/flink-python/pyflink/common/types.py b/flink-python/pyflink/common/types.py
index d3151bdafe3..b97d75e5635 100644
--- a/flink-python/pyflink/common/types.py
+++ b/flink-python/pyflink/common/types.py
@@ -177,7 +177,10 @@ class Row(object):
         return row
 
     def __contains__(self, item):
-        return item in self._values
+        if hasattr(self, "_fields") and self._fields is not None:
+            return item in self._fields
+        else:
+            return item in self._values
 
     # let object acts like class
     def __call__(self, *args):