Commit f2eaccf
committed
Address review: tighten return type, cache label, document key asymmetry
- _create_pdf_annotation return type Annotation (not Annotation | None) and remove dead 'if annot is not None' guard in caller — function raises on failure
- Cache ensure_label_and_labelset across loop iterations; reset on savepoint rollback so the happy path is one DB lookup, not N
- Document why json is in defaults for PDFs but a lookup key for spans
- Simplify test stub so it doesn't depend on SpanAnnotation internals
- Fix test page assertion: PlasmaPDF returns 0-indexed pages1 parent 14a20b8 commit f2eaccf
2 files changed
Lines changed: 37 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
518 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
519 | 521 | | |
520 | | - | |
521 | | - | |
| 522 | + | |
| 523 | + | |
522 | 524 | | |
523 | 525 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| |||
587 | 588 | | |
588 | 589 | | |
589 | 590 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
| 591 | + | |
595 | 592 | | |
596 | 593 | | |
597 | 594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
210 | 215 | | |
211 | 216 | | |
212 | 217 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
| |||
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
232 | | - | |
233 | | - | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
| 240 | + | |
236 | 241 | | |
237 | 242 | | |
238 | 243 | | |
| |||
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
256 | | - | |
| 261 | + | |
257 | 262 | | |
258 | 263 | | |
259 | 264 | | |
260 | | - | |
| 265 | + | |
261 | 266 | | |
262 | | - | |
263 | | - | |
264 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
| |||
289 | 295 | | |
290 | 296 | | |
291 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
292 | 305 | | |
293 | 306 | | |
294 | 307 | | |
| |||
0 commit comments