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 fa77fd4b133 [hotfix][python] Fix the KeyError in CachedMapState
fa77fd4b133 is described below

commit fa77fd4b1333b23a2769c77994644ba8a8d7d4ff
Author: huangxingbo <h...@apache.org>
AuthorDate: Thu Jan 19 15:07:50 2023 +0800

    [hotfix][python] Fix the KeyError in CachedMapState
---
 flink-python/pyflink/fn_execution/state_impl.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/flink-python/pyflink/fn_execution/state_impl.py 
b/flink-python/pyflink/fn_execution/state_impl.py
index 38668dd4e83..9ad1b8e6d4f 100644
--- a/flink-python/pyflink/fn_execution/state_impl.py
+++ b/flink-python/pyflink/fn_execution/state_impl.py
@@ -302,8 +302,9 @@ class CachedMapState(LRUCache):
         self._cached_keys = set()
 
         def on_evict(key, value):
-            self._cached_keys.remove(key)
-            self._all_data_cached = False
+            if value[0]:
+                self._cached_keys.remove(key)
+                self._all_data_cached = False
 
         self.set_on_evict(on_evict)
 

Reply via email to