Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'ClientOptions' object has no attribute 'api_audience'; google-cloud-core==2.2.3 is incompatible with google-api-core==2.8.2 #208

Closed
Ark-kun opened this issue Jul 26, 2022 · 3 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@Ark-kun
Copy link

Ark-kun commented Jul 26, 2022

It ;looks like google-cloud-core==2.2.3 is incompatible with google-api-core==2.8.2

AttributeError: 'ClientOptions' object has no attribute 'api_audience'

google-cloud-core==2.3.0 seems to be compatible.

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS type and version:
  • Python version: 3.7
  • pip version: pip --version
  • google-cloud-core version: 2.2.3

Steps to reproduce

  1. ?
  2. ?

Code example

# example

Stack trace

# example

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

@vam-google
Copy link

@atulep Can you please take a look? Looks like this change made it incompatible: googleapis/python-api-core#379

On the other hand, given our development workflow, since 2.3.0 works with latest version of google-api-core we would just recommend using that version or newer.

Also, can you please provide full stack trace on where exactly api_audience is being used in older version of google-cloud-core? Checking the diff of 2.2.3 and 2.3.0 (v2.2.3...v2.3.0) I can't spot a relevant difference.

@vam-google vam-google added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Jul 28, 2022
@Ark-kun
Copy link
Author

Ark-kun commented Jul 29, 2022

I lost the stack trace initially.

But now I've managed to recover it and I see that this issue is in another library - google-cloud-aiplatform
I apologize for the confusion.

/tmp/ipykernel_16859/1666459801.py in <module>
     54 if __name__ == '__main__':
     55     from google.cloud import aiplatform
---> 56     aiplatform.PipelineJob.from_pipeline_func(pipeline_func=pipeline_func).submit()

/opt/conda/lib/python3.7/site-packages/google/cloud/aiplatform/pipeline_jobs.py in submit(self, service_account, network, create_request_timeout, experiment)
    360         _LOGGER.log_create_with_lro(self.__class__)
    361 
--> 362         self._gca_resource = self.api_client.create_pipeline_job(
    363             parent=self._parent,
    364             pipeline_job=self._gca_resource,

/opt/conda/lib/python3.7/site-packages/google/cloud/aiplatform/utils/__init__.py in __getattr__(self, name)
    423     def __getattr__(self, name: str) -> Any:
    424         """Instantiates client and returns attribute of the client."""
--> 425         return getattr(self._clients[self._default_version], name)
    426 
    427     def select_version(self, version: str) -> VertexAiServiceClient:

/opt/conda/lib/python3.7/site-packages/google/cloud/aiplatform/utils/__init__.py in __getattr__(self, name)
    357                 credentials=self._credentials,
    358                 client_options=self._client_options,
--> 359                 client_info=self._client_info,
    360             )
    361             return getattr(temporary_client, name)

/opt/conda/lib/python3.7/site-packages/google/cloud/aiplatform_v1/services/pipeline_service/client.py in __init__(self, credentials, transport, client_options, client_info)
    626                 client_info=client_info,
    627                 always_use_jwt_access=True,
--> 628                 api_audience=client_options.api_audience,
    629             )
    630 

AttributeError: 'ClientOptions' object has no attribute 'api_audience'

The issue was introduced by googleapis/python-aiplatform#1454 and googleapis/googleapis@23f1a15

@Ark-kun
Copy link
Author

Ark-kun commented Nov 24, 2022

Hmm. It looks like aiplatform package already states it's not compatible with 2.2.*

"google-api-core >= 1.31.6, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",

@Ark-kun Ark-kun closed this as completed Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants