Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bare list/dict annotations leave GoogleAdsClient.get_service and generated request params partially unknown

Aperta
#1,093 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
grpc, python

Direzione di ricerca

Start with google/ads/googleads/client.py and the ads generator client.py.j2 template named in the issue, then reproduce the strict pyright diagnostics with the provided example. Update the annotations at both locations and verify that get_service and generated request parameters no longer produce partially unknown types; the issue describes these as annotation-only changes with no runtime effect.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

With google-ads 31.0.0 under pyright strict, two annotations without type arguments make every call site report reportUnknownMemberType:

  • GoogleAdsClient.get_service(..., interceptors: Union[list, None] = None, ...) in google/ads/googleads/client.py. list[grpc.UnaryUnaryClientInterceptor] or Sequence[...] would type it.
  • Every generated service method: request: Optional[Union[<Request>, dict]] = None, for example ConversionUploadServiceClient.upload_click_conversions. This comes from the ads generator template (packages/gapic-generator/gapic/ads-templates/.../client.py.j2 in googleapis/google-cloud-python). Dict[str, Any] would type it.

Repro:

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.v24.services.services.conversion_upload_service import ConversionUploadServiceClient

def f(c: GoogleAdsClient, s: ConversionUploadServiceClient) -> None:
    c.get_service("ConversionUploadService")  # Type of "get_service" is partially unknown
    s.upload_click_conversions(request=None)  # Type of "upload_click_conversions" is partially unknown

These are annotation-only changes with no runtime effect. Callers currently work around them with local Protocols.

Lingua principale
Python
Stelle
754
Fork
550
Merge medio
27m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleads/google-ads-python

Tutte le issue di googleads/google-ads-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.