aip_sdk.get_test_plan_by_id
aip_sdk.get_test_plan_by_id(test_plan_id: str, *, client: APIClient | None = None) -> TestPlanDetail
Read one published version of a test plan by its id alone.
The same read as get_test_plan, differing only in how the version is addressed: by the
id every record this module returns carries, as stored wherever the platform pins a plan
version. An id names exactly one version and the workspace it belongs to, so neither is
passed — no version, and no workspace_id, configured or otherwise.
Parameters
test_plan_idstr: Theidof the version to read. A plan name does not address anything here; useget_test_planfor that. Surrounding whitespace is trimmed; a literal/is refused, since a version id never contains one.clientAPIClient | None: Explicit API client. Uses the default client when omitted.
Returns
TestPlanDetail: TheTestPlanDetailfor that version — the plan body, its liverequired_columns,TestPlanDetail: and everything the workspace's catalogue no longer answers for.
Raises
InvalidArgumentError:test_plan_idis empty, contains/, or is not a string.TestPlanNotFoundError: No version has that id, or it belongs to a workspace the caller is not a member of — the two read the same, since existence is workspace-scoped.AuthError: Credentials are missing, invalid, or expired.ResponseParseError: A platform response did not match the shape this SDK version expects. Usually means the platform is running a newer release; upgrading resolves it.APIError: Any other error from the platform.
Examples
import aip_sdk as aip
# An id you already hold — stored from an earlier publish, or read off a pinned resource.
plan = aip.get_test_plan_by_id("tp_a1b2c3")
print(plan.name, "v", plan.version, plan.required_columns)
# Or the stamp a run carries, to name the plan version that scored it.
run = aip.get_run("run_abc123")
if run.test_plan_id is not None:
plan = aip.get_test_plan_by_id(run.test_plan_id)
print(plan.name, "v", plan.version)