rohdesamuel commented on a change in pull request #12703:
URL: https://github.com/apache/beam/pull/12703#discussion_r485084128



##########
File path: sdks/python/apache_beam/runners/interactive/recording_manager.py
##########
@@ -258,16 +278,44 @@ def _watch(self, pcolls):
         ie.current_env().watch(
             {'anonymous_pcollection_{}'.format(id(pcoll)): pcoll})
 
-  def clear(self, pcolls):
+  def _clear(self, pipeline_instrument):
     # type: (List[beam.pvalue.PCollection]) -> None
 
-    """Clears the cache of the given PCollections."""
+    """Clears the recording of all non-source PCollections."""
 
     cache_manager = ie.current_env().get_cache_manager(self.user_pipeline)
-    for pc in pcolls:
-      cache_key = self._pipeline_instrument.cache_key(pc)
+
+    # Only clear the PCollections that aren't being populated from the
+    # BackgroundCachingJob.
+    all_cached = set(
+        str(c.to_key()) for c in pipeline_instrument.cacheables.values())

Review comment:
       Gotcha, I can make a follow-up PR.




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