(self, manifest: Manifest)
Populate the relations cache for the given schemas. Returns an
        iterable of the schemas populated, as strings.
Populate the relations cache for the given schemas. Returns an
        iterable of the schemas populated, as strings.
Populate the relations cache for the given schemas . Returns an iterable of the schemas populated as strings .
def _relations_cache_for_schemas(self, manifest: Manifest) -> None:
        """Populate the relations cache for the given schemas. Returns an
        iterable of the schemas populated, as strings.
        """
        cache_schemas = self._get_cache_schemas(manifest)
        with executor(self.config) as tpe:
            futures: List[Future[List[BaseRelation]]] = []
            for cache_schema in cache_schemas:
                fut = tpe.submit_connected(
                    self,
                    f'list_{cache_schema.database}_{cache_schema.schema}',
                    self.list_relations_without_caching,
                    cache_schema
                )
                futures.append(fut)

            for future in as_completed(futures):
                # if we can't read the relations we need to just raise anyway,
                # so just call future.result() and let that raise on failure
                for relation in future.result():
                    self.cache.add(relation)

        # it's possible that there were no relations in some schemas. We want
        # to insert the schemas we query into the cache's `.schemas` attribute
        # so we can check it later
        cache_update: Set[Tuple[Optional[str], Optional[str]]] = set()
        for relation in cache_schemas:
            cache_update.add((relation.database, relation.schema))
        self.cache.update_schemas(cache_update)
def _relations_cache_for_schemas ( self , manifest : Manifest ) -> None : cache_schemas = self . _get_cache_schemas ( manifest ) with executor ( self . config ) as tpe : futures : List [ Future [ List [ BaseRelation ] ] ] = [ ] for cache_schema in cache_schemas : fut = tpe . submit_connected ( self , f'list_{cache_schema.database}_{cache_schema.schema}' , self . list_relations_without_caching , cache_schema ) futures . append ( fut ) for future in as_completed ( futures ) : # if we can't read the relations we need to just raise anyway, # so just call future.result() and let that raise on failure for relation in future . result ( ) : self . cache . add ( relation ) # it's possible that there were no relations in some schemas. We want # to insert the schemas we query into the cache's `.schemas` attribute # so we can check it later cache_update : Set [ Tuple [ Optional [ str ] , Optional [ str ] ] ] = set ( ) for relation in cache_schemas : cache_update . add ( ( relation . database , relation . schema ) ) self . cache . update_schemas ( cache_update )