-
Notifications
You must be signed in to change notification settings - Fork 305
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
Download specific files in FlyteDirectory #2059
Conversation
Signed-off-by: Kevin Su <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2059 +/- ##
==========================================
+ Coverage 85.98% 86.03% +0.05%
==========================================
Files 308 308
Lines 23016 23051 +35
Branches 3479 3489 +10
==========================================
+ Hits 19790 19832 +42
+ Misses 2616 2611 -5
+ Partials 610 608 -2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
you should also be able to do this using flytedirectory.crawl()... |
@@ -236,6 +236,66 @@ def new_dir(self, name: typing.Optional[str] = None) -> FlyteDirectory: | |||
def download(self) -> str: | |||
return self.__fspath__() | |||
|
|||
@classmethod | |||
def listdir(cls, directory: FlyteDirectory) -> typing.List[typing.Union[FlyteDirectory, FlyteFile]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not make this as an instance method on FlyteDirectory instead of class method?
Also i want to support async versions of all these methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add them to a separate PR.
it won't return flytefile. |
Tracking issue
NA
Why are the changes needed?
flytekit downloads the entire directory when calling
os.listdir(FlyteDirectory(...))
. However, users may only want to download the specific files they will use when the task is running.What changes were proposed in this pull request?
Add a new method called listdir in
FlyteDirectory
that can list all the files and folders in the given directory.listdir
only returns eitherflytefile
orFlyteDirectory
How was this patch tested?
Screenshots
Check all the applicable boxes
Related PRs
NA
Docs link
NA