<#4700 [BUG] Flytekit misuses unexpected fsspec lp...
# flyte-github
c
#4700 [BUG] Flytekit misuses unexpected fsspec lpath result Issue created by cgrass ### Describe the bug fsspec has unexpected behavior in some scenarios. calling get with a URL with query params for
rpath
(remote path) and a filename for
lpath
(local path) results in
lpath
being used as a path dir. e.g., if
rpath == http://www.ascii-art.de/ascii/s/startrek.txt?test=test2
and
lpath == /var/output.pb
a file gets written at
/var/output.pb/startrek.txt?test=test2
. this causes an issue in the flytekit code because remote._get_output_literal_map() creates
tmp_name
with the filename ("output.pb"), and then uses
tmp_name
as the location for the resulting file. in reality, that path is a dir that contains the actual file. trying to open
tmp_name
results in a
IsADirectoryError
. a discussion in slack can add more context. This is related to another bug I filed and could potentially be fixed with the same solution. ### Expected behavior remote file gets written to
/var/output.pb
### Additional context to reproduce You can see the fsspec behavior using the unit test below
Copy code
def test_get_output():
    kwargs = {}
    spec = fsspec.implementations.http.HTTPFileSystem(fsspec.filesystem("https", **kwargs))
    frompath = linkToUrlFileile ### must be url that includes query params, e.g., for presigned urls.
    topath = "/var/inputs10.txt"
    response = spec.get(frompath, topath, **kwargs)
    print(response)
e2e testing is much harder because it requires a specific flyte configuration (described in this PR). @thankful-minister-83577 was able to reproduce using a local setup. ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte