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

cannot log google ads logging v19 python client

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
api

調査の方向性

まず、google-ads 26.1.0 を使って、提供された Python 3.12.9 の例を再現し、logging.basicConfig と google.ads.googleads.client に重点を置きます。v17 と v19 でサービスをリクエストした場合のログ動作を比較します。v19 が期待される Google Ads のログを生成すれば完了です。

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

説明

Hi Google Ads team,

Since upgrading Google Ads API version to v19, I cannot get the Google Ads logging.

import asyncio
import logging
from google.protobuf.json_format import MessageToDict

logging.basicConfig(level=logging.INFO, format='[%(asctime)s - %(levelname)s] %(message).5000s')
logging.getLogger('google.ads.googleads.client').setLevel(logging.INFO)

import google.ads.googleads.client


def setup_google_ads_connection():
    google_ads_client = (
        google.ads.googleads.client.GoogleAdsClient.load_from_storage("googleads.yaml")
    )
    ga_service = google_ads_client.get_service("GoogleAdsService", version="v19")
    return google_ads_client, ga_service


async def main(google_ads_client, google_ads_service):
    cust_list = ["2978713003"]
    for cust_id in cust_list:
        asset_query = "SELECT segments.date,[campaign.id](http://campaign.id/),[ad_group.id](http://ad_group.id/),metrics.impressions,metrics.clicks,metrics.cost_micros,asset_field_type_view.field_type,metrics.video_views,metrics.cross_device_conversions FROM asset_field_type_view  WHERE segments.date >= '2025-03-05' AND segments.date <= '2025-03-05' AND metrics.impressions > 0 AND [campaign.id](http://campaign.id/) in ('21080449403')"
        setting = google_ads_client.get_type('SummaryRowSettingEnum').SummaryRowSetting.SUMMARY_ROW_WITH_RESULTS
        search_request = google_ads_client.get_type("SearchGoogleAdsStreamRequest")
        search_request.customer_id = cust_id
        search_request.query = asset_query
        search_request.summary_row_setting = setting
        _CLIENT_TIMEOUT_SECONDS = 400
        
        stream = google_ads_service.search_stream(
            search_request, 
            timeout=_CLIENT_TIMEOUT_SECONDS
        )
        result = []
        summary_result = []
        for batch in stream:
            summary_row = batch.summary_row
            summary_row = MessageToDict(
                    summary_row,
                    use_integers_for_enums=False,
                    preserving_proto_field_name=True
                )
            summary_result.append(summary_row)
            for row in batch.results:
                row = MessageToDict(
                    row,
                    use_integers_for_enums=False,
                    preserving_proto_field_name=True
                )
                result.append(row)

                
        if result:
            print(f"{cust_id} has data")

if __name__ == "__main__":
    google_ads_client, google_ads_service = setup_google_ads_connection()

    asyncio.run(
        main(google_ads_client, google_ads_service)
    )

I use python 3.12.9
Here's the version of library used in python when pip freeze

aiohttp==3.9.5
aiosignal==1.3.2
attrs==25.3.0
boto3==1.34.126
botocore==1.34.126
cachetools==5.5.2
certifi==2025.1.31
charset-normalizer==3.4.1
frozenlist==1.6.0
google-ads==26.1.0
google-api-core==2.24.2
google-auth==2.39.0
google-auth-oauthlib==1.2.2
googleapis-common-protos==1.70.0
googlemaps==4.10.0
grpcio==1.71.0
grpcio-status==1.62.3
idna==3.10
iso3166==2.1.1
jmespath==1.0.1
multidict==6.4.3
numpy==2.2.5
oauthlib==3.2.2
pandas==2.2.2
propcache==0.3.1
proto-plus==1.26.1
protobuf==4.25.7
psycopg2-binary==2.9.10
pyasn1==0.6.1
pyasn1_modules==0.4.2
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
redis==5.1.1
requests==2.32.3
requests-oauthlib==2.0.0
rsa==4.9.1
s3transfer==0.10.4
six==1.17.0
tzdata==2025.2
ujson==5.10.0
urllib3==2.4.0
uvloop==0.19.0
yarl==1.20.0

P/S: when I use v17, the logging is normal.

Can you guide me through the steps to get Google Ads logging again?

主要言語
Python
スター
749
フォーク
967
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

googleads/googleads-python-lib のほかの issue

googleads/googleads-python-lib の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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