OxbridgeEconomics
commited on
Commit
·
541436a
1
Parent(s):
b385711
commit
Browse files
utils.py
CHANGED
@@ -241,25 +241,25 @@ def update_content(report):
|
|
241 |
'id': {'S': str(report['id'])},
|
242 |
'site': {'S': report['site']}
|
243 |
},
|
244 |
-
UpdateExpression='SET title = :title, titleCN = :titleCN, contentCN = :contentCN, category = :category, author = :author, content = :content, subtitle = :subtitle, publishDate = :publishDate, link = :link, attachment = :attachment, sentimentScore = :sentimentScore, sentimentLabel = :sentimentLabel',
|
245 |
ExpressionAttributeValues={
|
246 |
-
'title': {'S': report['title']},
|
247 |
-
'titleCN': {'S': report['titleCN']},
|
248 |
-
'contentCN': {'S': report['contentCN']},
|
249 |
-
'category': {'S': report['category']},
|
250 |
-
'author': {'S': report['author']},
|
251 |
-
'content': {'S': report['content']},
|
252 |
-
'subtitle': {'S': report['subtitle']},
|
253 |
-
'publishDate': {'S': report['publishDate']},
|
254 |
-
'link': {'S': report['link']},
|
255 |
-
'attachment': {'S': report['attachment']},
|
256 |
# 'authorID': str(report['authorid']),
|
257 |
# 'entityList': report['entitylist'],
|
258 |
-
'sentimentScore': {'N': str(Decimal(str(report['sentimentScore'])).quantize(Decimal('0.01')))},
|
259 |
-
'sentimentLabel': {'S': report['sentimentLabel']},
|
260 |
-
'LastModifiedDate': {'S': datetime.now().strftime("%Y-%m-%dT%H:%M:%S")},
|
261 |
-
|
262 |
-
|
263 |
}
|
264 |
)
|
265 |
print(response)
|
|
|
241 |
'id': {'S': str(report['id'])},
|
242 |
'site': {'S': report['site']}
|
243 |
},
|
244 |
+
UpdateExpression='SET title = :title, titleCN = :titleCN, contentCN = :contentCN, category = :category, author = :author, content = :content, subtitle = :subtitle, publishDate = :publishDate, link = :link, attachment = :attachment, sentimentScore = :sentimentScore, sentimentLabel = :sentimentLabel, LastModifiedDate = :LastModifiedDate',
|
245 |
ExpressionAttributeValues={
|
246 |
+
':title': {'S': report['title']},
|
247 |
+
':titleCN': {'S': report['titleCN']},
|
248 |
+
':contentCN': {'S': report['contentCN']},
|
249 |
+
':category': {'S': report['category']},
|
250 |
+
':author': {'S': report['author']},
|
251 |
+
':content': {'S': report['content']},
|
252 |
+
':subtitle': {'S': report['subtitle']},
|
253 |
+
':publishDate': {'S': report['publishDate']},
|
254 |
+
':link': {'S': report['link']},
|
255 |
+
':attachment': {'S': report['attachment']},
|
256 |
# 'authorID': str(report['authorid']),
|
257 |
# 'entityList': report['entitylist'],
|
258 |
+
# 'sentimentScore': {'N': str(Decimal(str(report['sentimentScore'])).quantize(Decimal('0.01')))},
|
259 |
+
# 'sentimentLabel': {'S': report['sentimentLabel']},
|
260 |
+
':LastModifiedDate': {'S': datetime.now().strftime("%Y-%m-%dT%H:%M:%S")},
|
261 |
+
':sentimentScore': {'N': str(Decimal(str(report['sentimentscore'])).quantize(Decimal('0.01')))},
|
262 |
+
':sentimentLabel': {'S': report['sentimentlabel']}
|
263 |
}
|
264 |
)
|
265 |
print(response)
|