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_idstr: Dataset ID.version_idstr: Dataset version ID the partition is defined on.partition_idstr: ID of the partition to judge metrics against.metricsIterable[str] | None: Restrict the report to these metric names. A name that matches no trace metric is reported as unavailable withOP_NOT_FOUNDrather than omitted, so a stale selection gets an answer. WhenNone, every trace metric visible in the dataset's workspace is reported.clientAPIClient | None: Optional API client.
Returns
PartitionMetricAvailability: The per-metric verdicts; readavailable_metricsfor just the names that can run.PartitionMetricAvailability: Checkdeployment_checkedbefore treating those names as confirmed runnable — whenPartitionMetricAvailability: it isFalsethe platform could not determine what is deployed, and the verdictsPartitionMetricAvailability: describe the metrics' contracts alone. Checkground_truth_checkedtoo when thePartitionMetricAvailability: partition is TRACE-typed and the report includesagent.step_accuracyorPartitionMetricAvailability:agent.tool_selection_accuracy— when it isFalsethe platform could not read thePartitionMetricAvailability: version's ground-truth values, so neither metric'sAMBIGUOUS_TRACE_GROUND_TRUTHgatePartitionMetricAvailability: was actually evaluated.
Raises
InvalidArgumentError: Ifmetricsis given but empty, or contains a blank name.AuthError: If credentials are missing or invalid.NotFoundError: If the partition or dataset version does not exist, or the version belongs to a workspace the caller is not a member of.UnprocessableEntityError: If the version is not an agent-trace version.ResponseParseError: If the platform's response does not match this SDK version.