diff --git a/flytekit/core/data_persistence.py b/flytekit/core/data_persistence.py index 751ffb8b27..7035147016 100644 --- a/flytekit/core/data_persistence.py +++ b/flytekit/core/data_persistence.py @@ -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: