microsoft/graphrag · warning · NotImplementedError

Blob storage does yet not support listing keys.

Error message

Blob storage does yet not support listing keys.

What it means

AzureBlobStorage inherits the keys() API from the KeyValueStorageAbstraction but blob storage has no key-listing implementation yet. Any call raises NotImplementedError unconditionally.

Source

Thrown at packages/graphrag-storage/graphrag_storage/azure_blob_storage.py:234

        """Clear the cache."""

    def child(self, name: str | None) -> "Storage":
        """Create a child storage instance."""
        if name is None:
            return self
        path = str(Path(self._base_dir) / name) if self._base_dir else name
        return AzureBlobStorage(
            connection_string=self._connection_string,
            container_name=self._container_name,
            encoding=self._encoding,
            base_dir=path,
            account_url=self._account_url,
        )

    def keys(self) -> list[str]:
        """Return the keys in the storage."""
        msg = "Blob storage does yet not support listing keys."
        raise NotImplementedError(msg)

    def _keyname(self, key: str) -> str:
        """Get the key name."""
        return str(Path(self._base_dir) / key) if self._base_dir else key

    async def get_creation_date(self, key: str) -> str:
        """Get creation date for the blob."""
        try:
            key = self._keyname(key)
            container_client = self._blob_service_client.get_container_client(
                self._container_name
            )
            blob_client = container_client.get_blob_client(key)
            timestamp = blob_client.download_blob().properties.creation_time
            return get_timestamp_formatted_with_local_tz(timestamp)
        except Exception:  # noqa: BLE001
            logger.warning("Error getting key %s", key)
            return ""

View on GitHub (pinned to f40e9a26ce)

Solutions

  1. Avoid calling keys() on blob storage; track needed keys in your own metadata/index
  2. Switch that storage component to a backend implementing keys() (e.g. File/Redis if available)
  3. Guard generic code with hasattr/try-except NotImplementedError before enumerating
  4. File an upstream feature request / contribute an implementation using container list_blobs

Example fix

# before
all_cache_keys = store.keys()

# after
try:
    all_cache_keys = store.keys()
except NotImplementedError:
    all_cache_keys = []  # blob storage cannot enumerate keys
Defensive patterns

Strategy: fallback

Validate before calling

def safe_keys(store):
    try:
        return store.keys()
    except NotImplementedError:
        return []

Type guard

def supports_keys(store) -> bool:
    import inspect
    f = type(store).keys
    code = getattr(f, '__code__', None)
    return not (code and 'not support' in (code.co_consts[0] or '')) if code else True

Try / catch

try:
    ks = store.keys()
except NotImplementedError:
    ks = []  # or load from your own manifest of written keys

Prevention

When it happens

Trigger: Calling storage.keys() on an AzureBlobStorage instance, directly or via generic code that enumerates a KeyValueStorageAbstraction (e.g. cache inspection, debugging utilities, vector store cleanup loops).

Common situations: Porting pipelines that call keys() on the LLM cache or text cache storage after switching storage type to blob, or generic admin tooling that assumes every backend supports enumeration.

Related errors


AI-assisted analysis of microsoft/graphrag@f40e9a26ce (2026-08-27). Data as JSON: /api/errors/06129cbd32189471. Report an issue: GitHub.