fsspec / fsspec/gcsfs

Is there already a way to list metadata attributes?

Open
#545 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
398
Forks
181
Avg merge
2d 10h
Merged PRs (30d)
36

Description

I see::

    async def _getxattr(self, path, attr):
        """Get user-defined metadata attribute"""
        meta = (await self._info(path)).get("metadata", {})
        return meta[attr]

    getxattr = sync_wrapper(_getxattr)

Could we have as well something like:

    async def _listxattr(self, path, attr):
        """List all user-defined metadata attribute"""
        meta = (await self._info(path)).get("metadata", {})
        return meta

    listxattr = sync_wrapper(_listxattr)

My specific application is to check if a certain attribute exists and then x/y/z. I can do this at the moment with a try/except loop. If I had a list of available attributes then that would be a little cleaner.

Maybe this capability already exists?

Thanks, T.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for the _getxattr and getxattr entry points shown in the issue, then inspect how metadata is retrieved and wrapped for synchronous use. Confirm whether an existing API already lists attributes; if not, done means exposing the available metadata attributes and covering the requested behavior with the repository’s relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.