-
Notifications
You must be signed in to change notification settings - Fork 17
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: 'ClientInfo' object has no attribute 'to_grpc_metadata' #266
Comments
The code below uses ClientInfo from python-documentai-toolbox/google/cloud/documentai_toolbox/utilities/gcs_utilities.py Lines 27 to 28 in ecb656c
However there is also a ClientInfo in The latter one is the one used in gapic-generator-python. Changing the code below to use python-documentai-toolbox/google/cloud/documentai_toolbox/utilities/gcs_utilities.py Lines 27 to 28 in ecb656c
|
Thanks @parthea I'm not sure why this would be happening now, this has been working fine for quite a few versions. But I can try changing that import. |
@holtskinner ,
|
`google.api_core.client_info` -> `google.api_core.gapic_v1.client_info` Fixes #266
Not sure if this was just a copy-paste error, but there should be a comma after
|
I was able to reproduce this behavior in Python3.8 in the compiled library only. I'll also add in Samples (w/tests) for this import method to catch this. |
I think I see why this wasn't an issue earlier. In #249, I made changes to how |
) * fix: Changed `client_info` import `google.api_core.client_info` -> `google.api_core.gapic_v1.client_info` * Add examples for all document initialization options (w/tests) Fixes #266
@holtskinner thanks for addressing this so quickly! But now Im getting another error: the method 'from_batch_process_metadata' raises the following error, ValueError: Invalid Document - shardInfo.shardCount (1) does not match number of shards (1053) which is strange to me, since I expected to input my operation name (that succeeded FYI), and get all the wrapped documents. But the error is claiming that there are too many shards (?). The same thing happens if I use the 'from_gcs' method, passing the root directory (<root_operation> dir let's call it) of that operation output as gcs_prefix. If I use the <root_operation_dir>// as gcs_prefix, the method succeeds. |
Environment details
Steps to reproduce
python3 main.py
Code example
main.py:
Stack trace
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
The text was updated successfully, but these errors were encountered: