Skip to content

Commit

Permalink
Merge pull request #34 from openownership/fix_download_files_s3
Browse files Browse the repository at this point in the history
bodsdata.py: Fix issue with matching correct s3 folder
  • Loading branch information
radix0000 committed Sep 19, 2023
2 parents 1df1c59 + ea72719 commit a9ccfcb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bodsdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ def download_files_s3(source, s3_path_pattern, latest=False, bucket="bodsdata-oo
bucket = get_s3_bucket(bucket)
items = []

if not s3_path_pattern.startswith("^"): s3_path_pattern = f"^{s3_path_pattern}"

for item in bucket.objects.all():
if re.search(s3_path_pattern, item.key):
items.append(item.key)
Expand Down

0 comments on commit a9ccfcb

Please sign in to comment.