Commit c3ecaa9
authored
fix: Normalize query params in dataset create_items_public_url (#963)
`DatasetClient.create_items_public_url` (and its async twin) passed
`_build_params` output straight to `urlencode`, bypassing the
`_parse_params` normalization that the real HTTP request path applies.
As a result, boolean and list query params ended up as Python reprs in
the signed URL — e.g. `create_items_public_url(clean=True,
fields=['title', 'url'])` produced
`clean=True&fields=%5B%27title%27%2C+%27url%27%5D` instead of
`clean=true&fields=title,url`. Consumers of the shared URL then got
unclean/unfiltered items or an API error.
The fix routes the params through `self._http_client._parse_params(...)`
before `urlencode`, so the public URL matches exactly what an actual API
request would send (bool→`true`/`false`, list→comma-joined, `None`
dropped). Added regression tests for both the sync and async clients.
*✍️ Drafted by Claude Code*1 parent 55e88ef commit c3ecaa9
4 files changed
Lines changed: 66 additions & 47 deletions
File tree
- src/apify_client/_resource_clients
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
118 | 138 | | |
119 | 139 | | |
120 | 140 | | |
| |||
133 | 153 | | |
134 | 154 | | |
135 | 155 | | |
136 | | - | |
| 156 | + | |
137 | 157 | | |
138 | 158 | | |
139 | 159 | | |
| |||
203 | 223 | | |
204 | 224 | | |
205 | 225 | | |
206 | | - | |
| 226 | + | |
207 | 227 | | |
208 | 228 | | |
209 | 229 | | |
| |||
232 | 252 | | |
233 | 253 | | |
234 | 254 | | |
235 | | - | |
| 255 | + | |
236 | 256 | | |
237 | 257 | | |
238 | 258 | | |
| |||
395 | 415 | | |
396 | 416 | | |
397 | 417 | | |
398 | | - | |
| 418 | + | |
399 | 419 | | |
400 | 420 | | |
401 | 421 | | |
| |||
424 | 444 | | |
425 | 445 | | |
426 | 446 | | |
427 | | - | |
| 447 | + | |
428 | 448 | | |
429 | 449 | | |
430 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
606 | 605 | | |
607 | 606 | | |
608 | 607 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
| 608 | + | |
615 | 609 | | |
616 | 610 | | |
617 | 611 | | |
| |||
1172 | 1166 | | |
1173 | 1167 | | |
1174 | 1168 | | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
| 1169 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
425 | 424 | | |
426 | 425 | | |
427 | 426 | | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
| 427 | + | |
435 | 428 | | |
436 | 429 | | |
437 | 430 | | |
| |||
482 | 475 | | |
483 | 476 | | |
484 | 477 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
| 478 | + | |
492 | 479 | | |
493 | 480 | | |
494 | 481 | | |
| |||
853 | 840 | | |
854 | 841 | | |
855 | 842 | | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
| 843 | + | |
863 | 844 | | |
864 | 845 | | |
865 | 846 | | |
| |||
910 | 891 | | |
911 | 892 | | |
912 | 893 | | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
| 894 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
131 | 166 | | |
132 | 167 | | |
133 | 168 | | |
| |||
0 commit comments