"""Helper utilities for label-based query params."""

from __future__ import annotations

from typing import Any, Mapping


def attach_label_filters(
    labels: Mapping[str, str] | None,
    **kwargs: Any,
) -> dict[str, Any]:
    """Expand label filters into literal ``label.<key>`` query params."""
    params = dict(kwargs)
    if labels:
        params.update({f"label.{k}": v for k, v in labels.items()})
    return params
