Closed
Description
Similar to #3083
I am having the exact issue but with the google-cloud-language package. I am streaming tweets (working with Apache Beam) to the Language Sentiment Analysis API but some of them seem to break it.
class SentimentAnalyzerDoFn(beam.DoFn):
def process(self, element):
"""Takes a parsed tweet as input and add to it its sentiment score and values"""
from google.cloud import language
client = language.LanguageServiceClient()
document = language.types.Document(
content=element['tweet'].encode('utf-8'),
type='PLAIN_TEXT')
response = client.analyze_sentiment(
document=document,
encoding_type='UTF8')
sentiment = response.document_sentiment
element['sentiment_score'] = sentiment.score
element['sentiment_magnitude'] = sentiment.magnitude
yield element
The error I am getting is this:
RetryError: Exception occurred in retry method that was not classified as transient [while running 'SentimentAnalasys']
Is there a way to investigate it?
Activity