def getItem(jsonData, table):
if (type(jsonData) == str):
data = json.loads(jsonData)
else:
data = jsonData
projection_expression = data.get("ProjectionExpression")
key = data.get("Key")
if key is None:
message = "Unable to get item. Missing Key"
logger.error(message)
return None
if projection_expression is not None:
response = table.get_item(Key=key,ProjectionExpression=projection_expression)
else:
response = table.get_item(Key=key)
return response
评论列表
文章目录