Skip to main content

aip_sdk.get_partition_metric_availability

aip_sdk.get_partition_metric_availability(dataset_id: str, version_id: str, partition_id: str, *, metrics: Iterable[str] | None = None, client: APIClient | None = None) -> PartitionMetricAvailability

Report which trace metrics can score a partition, and why the rest cannot.

Each metric is judged against the span kinds the partition's occurrences actually carry and against the occurrence rows it would be scored on, so the verdict reflects this partition rather than the dataset as a whole. A partition narrowed to nothing reports PARTITION_HAS_NO_OCCURRENCES rather than an optimistic verdict.

A metric blocked with OP_MISSING_COLUMNS needs ground truth this version does not carry: attach it with aip.attach_ground_truth(), then re-check against the derived version and the target's new ID in migrated_partitions. One blocked with OP_NOT_DEPLOYED fits this partition but is not running in this environment — nothing about the data will unblock it, so ask whoever operates your platform to deploy it. One blocked with AMBIGUOUS_TRACE_GROUND_TRUTH (agent.step_accuracy / agent.tool_selection_accuracy only) is reported only when every occurrence a TRACE partition selects would score against its session's pooled ground truth for a session with more than one trace — both metrics reject that occurrence outright at scoring time rather than silently mis-scoring it, so a mixed partition (some traces with their own ground truth, some without) can still report available while the pooled-fallback traces are individually refused as FAILED rows if you run it; available=True never hides a bad number, a mixed partition just doesn't warn you in advance which rows will fail.

How closely this predicts run admission depends on the partition's granularity. For a SPAN partition the two agree by construction: run creation resolves the same stored selector and gates metrics against exactly these occurrences. For a TRACE or SESSION partition they can diverge — there the partition ID is a coarse provenance label on the results, since the selector narrows nothing when the whole trace or session is already the scope, so run creation gates metrics dataset-wide instead. Score the partition by passing its ID and the reported partition_type in a target to aip.run(pipeline="trace_metric_invoke", targets=[aip.RunTarget(partition_id=..., partition_type=...)]).

Parameters

  • dataset_id str: Dataset ID.
  • version_id str: Dataset version ID the partition is defined on.
  • partition_id str: ID of the partition to judge metrics against.
  • metrics Iterable[str] | None: Restrict the report to these metric names. A name that matches no trace metric is reported as unavailable with OP_NOT_FOUND rather than omitted, so a stale selection gets an answer. When None, every trace metric visible in the dataset's workspace is reported.
  • client APIClient | None: Optional API client.

Returns

Raises