Skip to content

Commit bde858a

Browse files
committed
fix 'is not in the subpath of' errors in integration tests
1 parent 8241a82 commit bde858a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

flytekit/remote/remote_fs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ async def _put_file(
147147
lpath = pathlib.Path(lpath)
148148
if _LPATH_ROOT_KEY in kwargs:
149149
lpath_root = pathlib.Path(kwargs.pop(_LPATH_ROOT_KEY))
150-
relative_subdirectory = str(lpath.parent.relative_to(lpath_root))
151-
if relative_subdirectory != ".":
152-
prefix += "/" + relative_subdirectory
150+
if lpath.parent.is_relative_to(lpath_root):
151+
relative_subdirectory = str(lpath.parent.relative_to(lpath_root))
152+
if relative_subdirectory != ".":
153+
prefix += "/" + relative_subdirectory
153154
_, native_url = self._remote.upload_file(
154155
lpath, self._remote.default_project, self._remote.default_domain, prefix
155156
)

0 commit comments

Comments
 (0)