Commit 13a63fc
Extract _raise_for_non_200 helper and trim PR #273 comments
The status-code guard appeared four times in waterdata/utils.py
(initial-request and pagination paths in both _walk_pages and
get_stats_data) with bit-identical bodies. Extract into a single
named helper; the helper's docstring carries the "silent-empty-frame"
WHY that the inline comment was apologizing for.
Also:
- trim the second multi-line comment in _walk_pages to a single line
noting the actual constraint (`resp` may be stale)
- hoist `import logging` to module level in waterdata_utils_test.py
- condense the two new test docstrings to one-line contract statements;
the bug history lives in the commit message
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 13b9032 commit 13a63fc
2 files changed
Lines changed: 19 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
371 | 382 | | |
372 | 383 | | |
373 | 384 | | |
| |||
612 | 623 | | |
613 | 624 | | |
614 | 625 | | |
615 | | - | |
616 | | - | |
| 626 | + | |
617 | 627 | | |
618 | 628 | | |
619 | 629 | | |
| |||
635 | 645 | | |
636 | 646 | | |
637 | 647 | | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
| 648 | + | |
643 | 649 | | |
644 | 650 | | |
645 | 651 | | |
646 | | - | |
647 | | - | |
648 | | - | |
| 652 | + | |
649 | 653 | | |
650 | 654 | | |
651 | 655 | | |
| |||
1079 | 1083 | | |
1080 | 1084 | | |
1081 | 1085 | | |
1082 | | - | |
1083 | | - | |
| 1086 | + | |
1084 | 1087 | | |
1085 | 1088 | | |
1086 | 1089 | | |
| |||
1106 | 1109 | | |
1107 | 1110 | | |
1108 | 1111 | | |
1109 | | - | |
1110 | | - | |
| 1112 | + | |
1111 | 1113 | | |
1112 | 1114 | | |
1113 | 1115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 127 | + | |
132 | 128 | | |
133 | 129 | | |
134 | 130 | | |
| |||
143 | 139 | | |
144 | 140 | | |
145 | 141 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 142 | + | |
152 | 143 | | |
153 | 144 | | |
154 | 145 | | |
| |||
0 commit comments