(self, session: AsyncSession, ids: List[int])
| 94 | self.logger.info(f"Write {len(data)} experiences to SQL storage.") |
| 95 | |
| 96 | async def _fetch_blobs(self, session: AsyncSession, ids: List[int]) -> Dict[int, bytes]: |
| 97 | stmt = select(self.blob_model_cls).where(self.blob_model_cls.id.in_(ids)) |
| 98 | result = await session.execute(stmt) |
| 99 | blobs = result.scalars().all() |
| 100 | return {b.id: b.experience_bytes for b in blobs} |
| 101 | |
| 102 | def _assemble_experiences(self, meta_rows, blob_map: Dict[int, bytes]) -> List[Experience]: |
| 103 | experiences = [] |