Esempio n. 1
0
 def cache_key_of(self, name, pcoll):
   return repr(
       instr.CacheKey(
           name,
           str(id(pcoll)),
           str(id(pcoll.producer)),
           str(id(pcoll.pipeline))))
Esempio n. 2
0
    def setUp(self):
        self.cache = InMemoryCache()
        self.p = beam.Pipeline()
        self.pcoll = self.p | beam.Create([])
        self.cache_key = str(pi.CacheKey('pcoll', '', '', ''))

        # Create a MockPipelineResult to control the state of a fake run of the
        # pipeline.
        self.mock_result = MockPipelineResult()
        ie.current_env().track_user_pipelines()
        ie.current_env().set_pipeline_result(self.p, self.mock_result)
        ie.current_env().set_cache_manager(self.cache, self.p)