Skip to content

Commit

Permalink
Async/exists check should use async function (#2901)
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor authored Nov 5, 2024
1 parent e0f0f52 commit 6e4e53b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flytekit/core/data_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,11 @@ async def get(self, from_path: str, to_path: str, recursive: bool = False, **kwa
return to_path
except OSError as oe:
logger.debug(f"Error in getting {from_path} to {to_path} rec {recursive} {oe}")
if not file_system.exists(from_path):
if isinstance(file_system, AsyncFileSystem):
exists = await file_system._exists(from_path) # pylint: disable=W0212
else:
exists = file_system.exists(from_path)
if not exists:
raise FlyteDataNotFoundException(from_path)
file_system = self.get_filesystem(get_protocol(from_path), anonymous=True, asynchronous=True)
if file_system is not None:
Expand Down

0 comments on commit 6e4e53b

Please sign in to comment.