Skip to content

Commit

Permalink
bodsdata.py: Fix issue with matching correct s3 folder in download_fi…
Browse files Browse the repository at this point in the history
…les_s3
  • Loading branch information
Ed (ODSC) committed Sep 19, 2023
1 parent 1df1c59 commit ea72719
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 ea72719

Please sign in to comment.