(self, data, records)
| 178 | return self.shard_records |
| 179 | |
| 180 | def _commit_internal(self, data, records): |
| 181 | data_path = f"{self.prefix}_{self.counter}.bin" |
| 182 | full_path = os.path.join(self.cache_dir, data_path) |
| 183 | self.counter += 1 |
| 184 | with open(full_path, "wb") as outfile: |
| 185 | outfile.write(data) |
| 186 | |
| 187 | shard_record = { |
| 188 | "dataPath": data_path, |
| 189 | "format": "raw-shard", |
| 190 | "nbytes": len(data), |
| 191 | "records": records, |
| 192 | "md5sum": _calculate_md5(full_path), |
| 193 | } |
| 194 | self.shard_records.append(shard_record) |
| 195 | |
| 196 | @property |
| 197 | def pending_nbytes(self): |
no test coverage detected