# extract_partition_key_paths

> **Function** in `langchain_azure_cosmosdb`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-cosmosdb/_utils/extract_partition_key_paths)

Extract partition key paths from a partition key definition.

Supports:

* ``azure.cosmos.PartitionKey`` instances with a single-path ``Hash`` /
  ``MultiHash``-of-one configuration. Hierarchical partition keys (HPK,
  multi-path) are explicitly rejected because the batch insertion code
  groups items by a single scalar partition-key value and would silently
  produce wrong groups for HPK.
* Plain dict definitions of the form ``{"paths": [...], "kind": ...}``
  following the same constraints.

## Signature

```python
extract_partition_key_paths(
    pk_def: Any,
) -> List[str]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pk_def` | `Any` | Yes | The partition key definition stored in ``container_properties["partition_key"]``. |

## Returns

`List[str]`

A list with exactly one path string (e.g. ``["/id"]``).

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/e62c2a55aaa0942fdac739b4066011953b80018e/libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_utils.py#L16)