I have a problem when trying to ingest data from s3 http link to python by using requests library. My code is as follows:
import gzip
import requests
def parse(url: str):
r = requests.get(url, stream=True)
data = gzip.decompress(r.content)
raw_data = []
for line in data.iter_lines():
raw_data.append(j.loads(line.decode("utf-8")))
return raw_data
raw_data = parse('https://s3-eu-west-1.amazonaws.com/path/of/bucket.json.gz')
When I run this, the code is running without giving error but it doesn't end. It looks like stuck. But the size of data 3.1 GB and I was not expecting too much. (Actually I waited more than 1 hour)
What can be the problem? Is there a suggestion from you?