ankitdobhal commented on a change in pull request #14920:
URL: https://github.com/apache/airflow/pull/14920#discussion_r599284089



##########
File path: airflow/sensors/smart_sensor.py
##########
@@ -672,13 +672,13 @@ def _execute_sensor_work(self, sensor_work):
 
     def flush_cached_sensor_poke_results(self):
         """Flush outdated cached sensor states saved in previous loop."""
-        for key, cached_work in self.cached_dedup_works.items():
+        for key, cached_work in self.cached_dedup_works.copy().items():

Review comment:
       Dictionaries are represented by a hash table and adding or removing 
items while iterating over it will alter the iteration order. This will cause a 
RuntimeError.
   
   If you need to add items to the dictionary during iteration, it is 
recommended to iterate over a shallow `copy` of the dictionary.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to