feat: add subdivision code to proxy configuration#878
feat: add subdivision code to proxy configuration#878daniil-poletaev merged 5 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #878 +/- ##
==========================================
+ Coverage 86.96% 87.01% +0.05%
==========================================
Files 48 48
Lines 2930 2942 +12
==========================================
+ Hits 2548 2560 +12
Misses 382 382
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
barjin
left a comment
There was a problem hiding this comment.
Thank you @daniil-poletaev , just a few nits from me (neither is blocking, address at your own discretion).
I'd rather wait for the Python folks for the final approve, therefore not approving (but it looks fine by me 👍 ).
| subdivision_code = str(subdivision_code) | ||
| _check(subdivision_code, label='subdivision_code', pattern=SUBDIVISION_CODE_REGEX) | ||
|
|
||
| if (proxy_urls or new_url_function or tiered_proxy_urls) and (groups or country_code or subdivision_code): |
There was a problem hiding this comment.
nit: I suppose subdivision_code implies country_code at this point (because otherwise L158 would have raised an exception), so the condition can stay the same
| if (proxy_urls or new_url_function or tiered_proxy_urls) and (groups or country_code): | ||
| if subdivision_code: | ||
| if not country_code: | ||
| raise ValueError('Cannot set "subdivision_code" without "country_code".') |
There was a problem hiding this comment.
Same as apify/apify-sdk-js#592 (comment), i.e. I'd rather mention ProxyConfiguration somewhere in the error message.
vdusek
left a comment
There was a problem hiding this comment.
Could you please also update the docs? This should be mentioned specifically in docs/02_concepts/05_proxy_management.mdx and docs/02_concepts/code/05_apify_proxy_config.py.
This PR adds new variable `subdivisionCode` and `apifyProxySubdivision` to Apify proxy configuration. This variable is currently needed for US state targeting. More context: https://apify.slack.com/archives/C010Q0FBYG3/p1776704073278519 Same PR in python: apify/apify-sdk-python#878
This PR adds new variable
subdivision_codeto Apify proxy configuration. This variable is currently needed for US state targeting.More context: https://apify.slack.com/archives/C010Q0FBYG3/p1776704073278519
Same PR in JS: apify/apify-sdk-js#592