Skip to content

Commit

Permalink
Make sentiment.score optional. (#3282)
Browse files Browse the repository at this point in the history
Fixes #3208.
  • Loading branch information
lukesneeringer authored Apr 11, 2017
1 parent 534ef81 commit 0d61119
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion language/google/cloud/language/sentiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def from_api_repr(cls, payload):
:rtype: :class:`Sentiment`
:returns: The sentiment parsed from the API representation.
"""
score = payload['score']
score = payload.get('score', None)
magnitude = payload['magnitude']
return cls(score, magnitude)

0 comments on commit 0d61119

Please sign in to comment.