Skip to content

Commit b09659a

Browse files
committed
Update download to use public URL instead of GCP library
1 parent 72fe5bb commit b09659a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/download_data.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from google.cloud import storage
2+
import urllib.request
33
import argparse
44

55
def load_data(path, key):
@@ -9,10 +9,8 @@ def load_data(path, key):
99
os.makedirs(path)
1010

1111
if not os.path.exists(os.path.join(path, key)):
12-
client = storage.Client.create_anonymous_client()
13-
bucket = client.bucket(bucket_name=gcsBucket, user_project=None)
14-
blob = storage.Blob(key, bucket)
15-
blob.download_to_filename(filename=os.path.join(path, key), client=client)
12+
url = "https://storage.googleapis.com/%s/%s" % (gcsBucket, key)
13+
urllib.request.urlretrieve(url, os.path.join(path, key))
1614

1715

1816
def main():

0 commit comments

Comments
 (0)