Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dest dir for direct S3 access before download #570

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is off by 2 spaces with the items above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! I'll sort that out with my other PR, where I've reformatted the section. I didn't want to create much of a merge conflict for myself here.

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
Loading