Giter VIP home page Giter VIP logo

Comments (2)

daavoo avatar daavoo commented on June 25, 2024

I have encountered the same behavior

from adlfs.

sugibuchi avatar sugibuchi commented on June 25, 2024

This problem comes from the handling of target_path in _details(...) method.

https://github.com/fsspec/adlfs/blob/2023.1.0/adlfs/spec.py#L919-L933

        if target_path:
            if (
                len(output) == 1
                and output[0]["type"] == "file"
                and not self.version_aware
            ):
                # This handles the case where path is a file passed to ls
                return output
            output = await filter_blobs(
                output,
                target_path,
                delimiter,
                version_id=version_id,
                versions=versions,
            )

This code applies utils.filter_blobs to output. But utils.filter_blobs assumes that target_path is a directory path.

https://github.com/fsspec/adlfs/blob/2023.1.0/adlfs/utils.py#L34

This is the reason why ls("my_container/path/to/dummy.txt") in the example returns an empty result.

In addition, if output contains only one entry and the entry is a file, this code returns output as it is. As a result, we get nonempty result for ls("my_container/path/to/dummy.txt.1") (OK) and ls("my_container/path/to/dummy.txt.") (KO).

I believe that _details(...) is probably not the best place to apply this filtering (target_path of this method is not documented and used only by _ls_blobs(...)). I think the filtering of retrieved entries should be done in _is_blobs(...).

from adlfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.