feat(sdk): set metric column-level upstreams
Merged
AC
3d ago+103+103+012345678901234567890123456789-4-4-0123456789
MetricUpstreams.fieldUpstreams is in the model, validated by MetricUpstreamsValidator, and drawn by the lineage graph as column ā metric edges. The SDK Metric had no way to set it.
Metric(upstream_fields=...),set_upstream_fields(...)and theupstream_fieldsproperty. They acceptstrorSchemaFieldUrn, singly or as a list.- A field whose dataset is not in
upstream_datasetsraisesValueError. So does narrowingupstream_datasetsunder existing fields. GMS rejects both, so the error now comes from the SDK call instead of the write. - Passing an empty list writes
fieldUpstreams: [], which clears stale column edges on re-ingest. Leavingupstream_fieldsunset leaves the aspect as it was.
It is split out from the MicroStrategy stack, where the semantic-model metrics use it.
š¤ Generated with Claude Code
Summary by cubic
Adds upstream_fields support to the SDK Metric, so column-level upstreams can be set on metrics. The model already stores and validates MetricUpstreams.fieldUpstreams and the lineage graph draws it as column ā metric edges, but the SDK had no way to populate it.
Metric(upstream_fields=...)accepts a singlestrorSchemaFieldUrn, or a list of them;set_upstream_fields(...)and theupstream_fieldsproperty accept the same.- A field whose dataset is not in
upstream_datasetsraisesValueError, as does narrowingupstream_datasetsunder existing fields; GMS rejects both, so the error now surfaces at the SDK call instead of the write. - Passing an empty list writes
fieldUpstreams: [], clearing stale column edges on re-ingest; leavingupstream_fieldsunset leaves the aspect unchanged.