Skip to content

Cannot retrieve async services via GoogleAdsClient.get_service ? #1024

@deathbymochi

Description

@deathbymochi

Describe the bug:
I see that there are async versions of Google Ads services, but they don't seem to be retrievable via the standard get_service method on GoogleAdsClient. The way that the service path / service name is being constructed doesn't seem to allow you to access the async versions of clients. If there's another way to retrieve the async client, that'd also be great - thanks!

Steps to Reproduce:

        # GOOGLE_ADS_API_VERSION = "v21"
        googleads_client = GoogleAdsClient.load_from_env(version=GOOGLE_ADS_API_VERSION)

        adgroup_service: AdGroupServiceAsyncClient = googleads_client.get_service(
            "AdGroupServiceAsync",
            version=GOOGLE_ADS_API_VERSION,
        )

Results in error: Image

Expected behavior:

        # should return the async client 
        adgroup_service: AdGroupServiceAsyncClient = googleads_client.get_service(
            "AdGroupServiceAsync",
            version=GOOGLE_ADS_API_VERSION,
        )

Client library version and API version:
Client library version: 28.0.0
Google Ads API version: v21

Request/Response Logs:

Anything else we should know about your project / environment:

Metadata

Metadata

Assignees

Labels

difficulty: mediumIntermediate difficulty; some experience with codebase may be helpfulenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions