I am having issues understanding what is needed for the client variable in exercise 2 for 4.1 Load Data Item by Item. I ran the previous code for the client object, but the next code has client.put_item(), and the variable client is set to None. I don’t know what needs to be placed for the code to function. Any guidance would be helpful!
Hello @mirandamm228
Just like exercise 1, you can use the boto3 library to get the DynamoDB client. The answer would be this:
client = boto3.client("dynamodb")
Hello @mirandamm228,
In Exercise 2 same as you did in Exercise 1 you need to create a function using the client to put an item instead of creating a table. After you create a client object with boto3.client("dynamodb")
you need to use it with the variable names: table _name and kwargs** but also the item. Since it’s a practice lab the solutions are available here:
-
Go to file>preferences>settings
-
Scroll down to
files exclude
in settings and click the x mark next to**/C2_W1_Lab_2_DynamoDB_Solution.ipynb
. The solutions will appear in your notebook section. Hope it helps:
Thank you for the help! I assumed that running the previous cell containing it was enough and didn’t think I needed to do it again, but now it seems obvious.