This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
ValueError: Protocol message Document has no "type" field. #43
Labels
api: language
Issues related to the googleapis/python-language API.
priority: p2
Moderately-important priority. 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
product-auto-label
bot
added
the
api: language
Issues related to the googleapis/python-language API.
label
Oct 22, 2020
I am having the same problem. Let me know if you salved this somehow. Thanks! |
i have the same question. And when i downgrade my google.cloud.language to 1.3.0, python still went wrong saying "do not have the attribute document" |
Hi, The attribute is renamed to |
Okay thank you @busunkim96. For those who didn't have understand, here's the code fixed. def gcl_analyze_syntax(sentence):
client = language_v1.LanguageServiceClient()
type_ = language_v1.Document.Type.PLAIN_TEXT
language = "fr"
document = {"content": sentence, "type_": type_, "language": language}
encoding_type = language_v1.EncodingType.UTF8
tokens = client.analyze_syntax(request = {'document': document, 'encoding_type': encoding_type}).tokens
return tokens |
The samples and RST files need to be updated with this change. |
busunkim96
added
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
and removed
🚨
This issue needs some love.
api: language
Issues related to the googleapis/python-language API.
triage me
I really want to be triaged.
labels
Oct 27, 2020
yoshi-automation
added
🚨
This issue needs some love.
triage me
I really want to be triaged.
labels
Oct 27, 2020
busunkim96
added
priority: p2
Moderately-important priority. Fix may not be included in next release.
api: language
Issues related to the googleapis/python-language API.
and removed
🚨
This issue needs some love.
triage me
I really want to be triaged.
labels
Oct 28, 2020
Fixed in #49 . |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
api: language
Issues related to the googleapis/python-language API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Hello,
I've got an issue since I've passed my project to google-cloud-language 2.0.0.
I tried on the Cloud Shell Protocol offered by the official documentation. This bug appears everytime.
Environment details
google-cloud-language
version: 2.0.0pip freeze
asgiref==3.2.10
cachetools==4.0.0
certifi==2019.11.28
chardet==3.0.4
colorama==0.4.4
cygrpc==1.0.4.post6
google-api-core==1.23.0
google-api-python-client==1.12.4
google-auth==1.22.1
google-auth-httplib2==0.0.4
google-cloud==0.34.0
google-cloud-language==2.0.0
googleapis-common-protos==1.6.0
grpcio==1.31.0
grpcio-tools==1.23.0
idna==2.8
libcst==0.3.13
oauth2client==4.1.3
packaging==20.4
pkginfo==1.6.0
proto-plus==1.11.0
protobuf==3.13.0
Steps to reproduce
Code example
or
Stack trace
Thanks,
Arthur
The text was updated successfully, but these errors were encountered: