Skip to content

chore: bump Pinterest-Generated-Client to 0.1.12 - #177

Merged
dfana01 merged 2 commits into
pinterest:mainfrom
munds:bump-genclient-0.12
Sep 1, 2026
Merged

chore: bump Pinterest-Generated-Client to 0.1.12#177
dfana01 merged 2 commits into
pinterest:mainfrom
munds:bump-genclient-0.12

Conversation

@munds

@munds munds commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Problem (Why)

Integration tests were still pinned to Pinterest-Generated-Client==0.1.10. After moving to 0.1.12, two things no longer match live Ads API behavior:

  1. Some invalid requests that the SDK previously wrapped as SdkException or failed as AssertionError now fail at the HTTP layer. The generated client raises ApiException (HTTP 400) instead.
  2. The test ad account requires Campaign Budget Optimization, so campaign creates without is_campaign_budget_optimization=True fail before the cases under test can run.

Solution (What + How)

Bump Pinterest-Generated-Client from 0.1.10 to 0.1.12 in requirements.txt, then align ads integration tests with the new client and account constraints:

  • Expect ApiException for unsupported ad-group tracking-URL event types and for keyword create without match_type.
  • Pass is_campaign_budget_optimization=True on campaign create (including CampaignUtils helpers) so CBO-required accounts succeed, and so the missing-budget failure case still hits API error 2384.

Test Plan

  • Install deps with the new client pin (Pinterest-Generated-Client==0.1.12).
  • Run ads integration tests, especially:
    • integration_tests/ads/test_campaigns.py
    • integration_tests/ads/test_ad_groups.py
    • integration_tests/ads/test_keywords.py
  • Confirm campaign create succeeds with CBO enabled and a daily spend cap.
  • Confirm the campaign missing-budget case still fails with error 2384.
  • Confirm ad-group tracking-URL and keyword-without-match_type cases fail with ApiException rather than AssertionError / SdkException.

munds and others added 2 commits August 28, 2026 19:11
…on tests

Update integration tests to match new generated client behavior:
- API errors now surface as ApiException instead of SdkException/AssertionError
- Campaign creation requires is_campaign_budget_optimization=True for the test account
… bump-genclient-0.12

Co-authored-by: Cursor <cursoragent@cursor.com>
@munds

munds commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author
(.venv) {19:52}~/Code/repos/pinterest-python-sdk:bump-genclient-0.12 ✓ ➭ make integration_tests                            
cleaning organic data...
python -m pytest ./integration_tests/clean_organic_data.py
/Users/amundayoor/Code/repos/pinterest-python-sdk/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
=================================================================================================================================================== test session starts ===================================================================================================================================================
platform darwin -- Python 3.9.6, pytest-7.1.2, pluggy-1.6.0
rootdir: /Users/amundayoor/Code/repos/pinterest-python-sdk, configfile: pytest.ini
plugins: requests-mock-1.8.0, cov-7.1.0
collected 1 item                                                                                                                                                                                                                                                                                                          

integration_tests/clean_organic_data.py .                                                                                                                                                                                                                                                                           [100%]

==================================================================================================================================================== 1 passed in 1.10s ====================================================================================================================================================
integration tests...
python -m pytest --ignore=clean_organic_data.py --cov ./pinterest/ --cov-branch ./integration_tests/ --cov-report term-missing
/Users/amundayoor/Code/repos/pinterest-python-sdk/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
=================================================================================================================================================== test session starts ===================================================================================================================================================
platform darwin -- Python 3.9.6, pytest-7.1.2, pluggy-1.6.0
rootdir: /Users/amundayoor/Code/repos/pinterest-python-sdk, configfile: pytest.ini
plugins: requests-mock-1.8.0, cov-7.1.0
collected 94 items                                                                                                                                                                                                                                                                                                        

integration_tests/test_pinterest_base_model.py ...........                                                                                                                                                                                                                                                          [ 11%]
integration_tests/ads/test_ad_accounts.py .....                                                                                                                                                                                                                                                                     [ 17%]
integration_tests/ads/test_ad_groups.py ..........                                                                                                                                                                                                                                                                  [ 27%]
integration_tests/ads/test_ads.py ........                                                                                                                                                                                                                                                                          [ 36%]
integration_tests/ads/test_audiences.py ....                                                                                                                                                                                                                                                                        [ 40%]
integration_tests/ads/test_campaigns.py ...........                                                                                                                                                                                                                                                                 [ 52%]
integration_tests/ads/test_conversion_events.py ..                                                                                                                                                                                                                                                                  [ 54%]
integration_tests/ads/test_conversion_tags.py ......                                                                                                                                                                                                                                                                [ 60%]
integration_tests/ads/test_customer_lists.py .........                                                                                                                                                                                                                                                              [ 70%]
integration_tests/ads/test_keywords.py ....                                                                                                                                                                                                                                                                         [ 74%]
integration_tests/client/test_client.py .....                                                                                                                                                                                                                                                                       [ 79%]
integration_tests/organic/test_boards.py ..........s...                                                                                                                                                                                                                                                             [ 94%]
integration_tests/organic/test_pins.py .....                                                                                                                                                                                                                                                                        [100%]

===================================================================================================================================================== tests coverage ======================================================================================================================================================
_____________________________________________________________________________________________________________________________________ coverage: platform darwin, python 3.9.6-final-0 _____________________________________________________________________________________________________________________________________

Name                                      Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------------------------
pinterest/__init__.py                         1      0      0      0   100%
pinterest/ads/__init__.py                     0      0      0      0   100%
pinterest/ads/ad_accounts.py                 59      1      0      0    98%   221
pinterest/ads/ad_groups.py                  157      3     14      4    96%   320->323, 361, 363, 421
pinterest/ads/ads.py                        163      4     12      5    95%   394, 396, 398, 428, 429->431
pinterest/ads/audiences.py                   82      2      6      3    94%   162->164, 165, 231
pinterest/ads/campaigns.py                  130     14      6      2    88%   345, 377-389, 401-413, 422, 431, 445-446, 498
pinterest/ads/conversion_events.py           17      0      0      0   100%
pinterest/ads/conversion_tags.py             80      4      2      1    94%   261, 309-314
pinterest/ads/customer_lists.py              78      0      0      0   100%
pinterest/ads/keywords.py                    71      2      4      2    95%   122, 186
pinterest/bin/__init__.py                     0      0      0      0   100%
pinterest/bin/get_config.py                  11     11      4      0     0%   4-29
pinterest/client/__init__.py                 73     11     12      5    81%   33, 36-41, 43->46, 80, 92-96, 113, 119
pinterest/config.py                          26      0      0      0   100%
pinterest/organic/__init__.py                 0      0      0      0   100%
pinterest/organic/boards.py                 147      9     18      7    90%   70, 151, 183, 289, 319, 352, 398, 440, 548
pinterest/organic/pins.py                   132     19     18      2    78%   176, 240, 279, 361-383
pinterest/utils/__init__.py                   0      0      0      0   100%
pinterest/utils/base_model.py                87      7     30      2    91%   44, 47-50, 204, 210
pinterest/utils/bookmark.py                  20      5      4      2    71%   47, 49-51, 61
pinterest/utils/error_handling.py            24      2     12      2    89%   34, 59
pinterest/utils/load_json_config.py          31      5     12      3    77%   19, 35-38, 49
pinterest/utils/refresh_access_token.py      17      2      6      2    83%   57, 62
pinterest/utils/sdk_exceptions.py            18      2      6      2    83%   24, 27
pinterest/version.py                          1      0      0      0   100%
-------------------------------------------------------------------------------------
TOTAL                                      1425    103    166     44    90%
======================================================================================================================================== 93 passed, 1 skipped in 189.25s (0:03:09) ========================================================================================================================================

@dfana01
dfana01 merged commit 4cbd005 into pinterest:main Sep 1, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants