Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BUG - Cannot Update Ad with Custom Pinterest SDK Client

オープン
#152 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
api

調査の方向性

Search for the Ad.update_fields entry point shown in the issue and trace its call to self._update. Reproduce an update using a custom Pinterest SDK Client, then verify that the client is not passed into AdUpdateRequest and that the update completes without authentication or type errors.

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug

When using a custom Pinterest SDK Client, I am unable to make updates to an ad, ad group, or campaign

To Reproduce

Currently, I am using a custom Pinterest SDK Client to authenticate, meaning the default client is unauthenticated. The client is initialized successfully, and I am able to fetch an ad successfully using ad = Ad(account_id, ad_id, client=self.client). However, once I run ad.update_fields(status=new_status) this operation fails saying I am not authenticated.

I then attempted to use ad.update_fields(status=new_status, client=self.client), however this results in a type error. After doing some digging, this error seems to originate from this code block

def update_fields(self, **kwargs) -> bool:
    """
    Update Ad fields suing any arguments

    Returns:
        bool: If Ad fields were updated successfully
    """
    if "creative_type" in kwargs:
        kwargs["creative_type"] = CreativeType(kwargs["creative_type"])
    if "status" in kwargs:
        kwargs["status"] = EntityStatus(kwargs["status"])
    return self._update(
        params={
            "ad_account_id": self._ad_account_id,
            "ad_update_request": [
                AdUpdateRequest(
                    id=self._id,
                    **kwargs
                )
            ]
        },
        api=AdsApi,
        update_fn=AdsApi.ads_update,
        **kwargs
    )

as passing a client object in here causes it to be passed into both AdUpdateRequest and self._update due to the use of **kwargs. After cloning the repo and making a change to include client=None in the update_fields function definition and client=client in the self._update function parameters, the function works as expected.

Expected behavior

I should be able to update ad status with a custom Pinterest SDK Client

Screenshots

Image
Image

Additional Details (please complete the following information):

  • OS and Version: MacOS Sequoia Version 15.4.1
  • SDK Version: 0.2.4
主要言語
Python
スター
85
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pinterest/pinterest-python-sdk のほかの issue

pinterest/pinterest-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。