Method
_validate_ids
(self, inputs: Iterable[JsonDict])
Source from the content-addressed store, hash-verified
| 238 | return (self._name, d_id) if (d_id := d.get("_id")) else None |
| 239 | |
| 240 | def _validate_ids(self, inputs: Iterable[JsonDict]): |
| 241 | for ex in inputs: |
| 242 | if not (given_id := ex.get("_id")): |
| 243 | continue |
| 244 | if (computed_id := self._id_hash_fn(types.Input(ex))) != given_id: |
| 245 | raise ValueError( |
| 246 | f"Given id '{given_id}' does not match computed id '{computed_id}'" |
| 247 | f" for example {str(ex)}." |
| 248 | ) |
| 249 | |
| 250 | ## |
| 251 | # For internal use |
Tested by
no test coverage detected