Skip to content

Commit

Permalink
Create dest dir for direct S3 access before download (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo authored May 13, 2024
1 parent 9059121 commit 3a0fb8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* Bug fixes:
* fixed 483 by extracting a common CMR query method for collections and granules using SearchAfter header
* Added VCR support for verifying the API call to CMR and the parsing of returned results without relying on CMR availability post development
* [#562](https://github.com/nsidc/earthaccess/issues/562): The destination
path is now created prior to direct S3 downloads, if it doesn't already
exist.

* Enhancements:
* Corrected and enhanced static type hints for functions and methods that make
Expand Down
3 changes: 3 additions & 0 deletions earthaccess/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ def _get_granules(
else:
print(f"Accessing cloud dataset using provider: {provider}")
s3_fs = self.get_s3fs_session(provider=provider)

local_path.mkdir(parents=True, exist_ok=True)

# TODO: make this async
for file in data_links:
s3_fs.get(file, str(local_path))
Expand Down

0 comments on commit 3a0fb8f

Please sign in to comment.