Skip to content

excluding client from kwargs#154

Merged
dfana01 merged 1 commit intopinterest:mainfrom
JaxGames5225:pinterest-custom-client-bug-fix
Aug 14, 2025
Merged

excluding client from kwargs#154
dfana01 merged 1 commit intopinterest:mainfrom
JaxGames5225:pinterest-custom-client-bug-fix

Conversation

@jburg-pmg
Copy link
Contributor

@jburg-pmg jburg-pmg commented Jul 22, 2025

Summary

Currently, if a user does not have credentials loaded into their environment or a config file on import, they are unable to update the fields of an ad, ad group, campaign, or audience. This is because it is impossible to pass a custom Pinterest client object into the update_fields function for each of those objects.

The root of this problem is within the update_fields function, where kwargs is passed into self._update and into self._update via the params input. When client is passed into the update_fields function, it is treated as a kwarg and is therefor passed into self._update twice. As client should not be passed into self._update via params, by explicitly adding an argument for client, the variable is excluded from kwargs and the function performs as expected.

Changes

  • In ad_groups.py, ads.py, audiences.py, and campaigns.py, client was added as an argument with None as the default value for the update_fields function. That argument is then explicitly passed into self._update

Testing

  • This was tested locally, and updates were successfully made to platform

@dfana01 dfana01 merged commit 82c6802 into pinterest:main Aug 14, 2025
4 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.

3 participants