I am trying to get contents of files in s3 and for that at first I am getting the list of the files from different folders/subfolders for which I will get the contents. However, I have realized that my method does not give me all the files in that bucket and it only reads less than the half of the files in the folders/subfolders and I am not sure what I am doing wrong. Here is my code:
def get_s3_list(bucket, prefix):
s3 = boto3.client("s3")
objects = s3.list_objects_v2(Bucket=bucket, Prefix=prefix)
I think the part where I get s3.list_objects_v2 needs to be modified but I am not familiar with it. Thanks in advance.