Commit 8c86ebd
Apply simplify findings: extract _warn_wqx3_unavailable, fix get_results
- Extract `_warn_wqx3_unavailable()` next to `_warn_wqx3_use()` and
`_warn_legacy_use()`. Replaces 6 copies of an identical 4-line
`warnings.warn(...)` block with a single helper call. `stacklevel=3`
preserves the original `stacklevel=2` semantics through the extra
helper frame.
- Collapse `if legacy is True: url = ... else: warn(); url = ...`
branches in 6 helpers — both arms assigned the same legacy URL — to
`if not legacy: warn()` followed by a single assignment.
- Apply the same `TypeError(msg, msg)` -> `ValueError(single_msg)` fix
to `get_results`'s two `dataProfile` validators (the same broken
pattern this PR already fixed in `wqp_url`/`wqx3_url`); also fixes
the missing space in the joined "WQX3.0profile" message.
- Add 2 regression tests for the `get_results` error paths.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 99d7598 commit 8c86ebd
2 files changed
Lines changed: 44 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
267 | 261 | | |
268 | 262 | | |
269 | 263 | | |
| |||
310 | 304 | | |
311 | 305 | | |
312 | 306 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
322 | 310 | | |
323 | 311 | | |
324 | 312 | | |
| |||
440 | 428 | | |
441 | 429 | | |
442 | 430 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
452 | 434 | | |
453 | 435 | | |
454 | 436 | | |
| |||
499 | 481 | | |
500 | 482 | | |
501 | 483 | | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
511 | 487 | | |
512 | 488 | | |
513 | 489 | | |
| |||
559 | 535 | | |
560 | 536 | | |
561 | 537 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
571 | 541 | | |
572 | 542 | | |
573 | 543 | | |
| |||
619 | 589 | | |
620 | 590 | | |
621 | 591 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
631 | 595 | | |
632 | 596 | | |
633 | 597 | | |
| |||
744 | 708 | | |
745 | 709 | | |
746 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
0 commit comments