Skip to content

Commit

Permalink
Fix issue in FlyteDirectory.listdir
Browse files Browse the repository at this point in the history
Fixes flyteorg/flyte#6005

Signed-off-by: Pim de Haan <[email protected]>
  • Loading branch information
pimdh committed Nov 13, 2024
1 parent a6d6335 commit c063eae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flytekit/types/directory/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,11 @@ def listdir(cls, directory: FlyteDirectory) -> typing.List[typing.Union[FlyteDir
file_access = FlyteContextManager.current_context().file_access
if not file_access.is_remote(final_path):
for p in os.listdir(final_path):
if os.path.isfile(os.path.join(final_path, p)):
paths.append(FlyteFile(p))
joined_path = os.path.join(final_path, p)
if os.path.isfile(joined_path):
paths.append(FlyteFile(joined_path))
else:
paths.append(FlyteDirectory(p))
paths.append(FlyteDirectory(joined_path))
return paths

def create_downloader(_remote_path: str, _local_path: str, is_multipart: bool):
Expand Down

0 comments on commit c063eae

Please sign in to comment.