I wrote this function to return data from table where Artist name is Joe. But the code below is not resulting anything. It does first print. But after that nothing. Not sure what I am doing wrong.
from __future__ import print_function # Python 2/3 compatibility
import json
import boto3
from boto3.dynamodb.conditions import Key, Attr
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Music')
def handler(event, context):
print("Joe's music")
print(table.creation_date_time)
response = table.query(
KeyConditionExpression=Key('Artist').eq('Joe')
)
for i in response['Items']:
print(i['Artist'], ":", i['Artist'])
Here is the result I am getting.
START RequestId: ...... Version: $LATEST
Joe's music
2017-07-19 03:07:54.701000+00:00
END RequestId: ...