Skip to content

Conversation

@zeryx
Copy link
Contributor

@zeryx zeryx commented Sep 16, 2021

Multiple customers and users have complained over the lack of support regarding downloading an entire data directory at once; preserving filenames and internal files. This PR adds a method to the data directory called getDir(); this provides a temporary file in the users scratch space that preserves the heirarchy and datafiles + correct names of all files contained within.
This PR has not added this functionality to the LocalDirectory system; and has been tested to function with S3 buckets

@zeryx zeryx self-assigned this Sep 16, 2021
@zeryx zeryx requested a review from kennydaniel September 17, 2021 14:08
@zeryx zeryx changed the title Algo-XXX proide a getDir() path [WIP] Algo-XXX proide a getDir() path Sep 17, 2021
@zeryx zeryx changed the title Algo-XXX proide a getDir() path Algo-XXX proide a getDir() path for Data Directories Sep 17, 2021
@zeryx zeryx changed the title Algo-XXX proide a getDir() path for Data Directories Algo-XXX proide a getDir() path for Data Directories Sep 17, 2021
@zeryx zeryx requested a review from lemonez September 17, 2021 14:51

# Get file from the data api
def getFile(self):
def getFile(self, as_path=False):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also added a default null flag to getFile so that we can actually skip the .name weirdness and stop having dangling file handles 🎉

local_file = file.getFile(as_path=True)
os.rename(local_file, correct_file_path)
return directory

Copy link
Contributor

Choose a reason for hiding this comment

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

delete extra newline

@zeryx zeryx requested a review from lemonez September 17, 2021 15:05
Copy link
Contributor

@kennydaniel kennydaniel left a comment

Choose a reason for hiding this comment

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

I kicked CI and it passed.

Re: as_path: I thought we had figured out a way to make all DataFiles a file-like object in python? Either way looks fine but not sure why that was needed here?

@zeryx zeryx merged commit b91cbf1 into develop Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants