diff --git a/deploy/gen_warehouse_workflow_draft.js b/deploy/gen_warehouse_workflow_draft.js index c1c5cf4..fc02e27 100644 --- a/deploy/gen_warehouse_workflow_draft.js +++ b/deploy/gen_warehouse_workflow_draft.js @@ -252,7 +252,8 @@ def type_union(t): return {"com.linkedin.schema.StringType": {}} def propose(aspect_name, urn, value): - body = {"proposal": {"entityType": "dataset", "entityUrn": urn, "changeType": "UPSERT", "aspectName": aspect_name, + etype = "schemaField" if urn.startswith("urn:li:schemaField:") else "dataset" + body = {"proposal": {"entityType": etype, "entityUrn": urn, "changeType": "UPSERT", "aspectName": aspect_name, "aspect": {"contentType": "application/json", "value": json.dumps(value)}}} r = requests.post(DH + "/aspects?action=ingestProposal", headers=HDRS, json=body, timeout=25) return ("ok" if r.status_code == 200 and "success" in r.text else "err", r.text[:100]) @@ -292,7 +293,8 @@ def main(item: str): r6 = ("skip", "") if op.get("term_fields"): r6 = propose("editableSchemaMetadata", urn, { - "editableSchemaFieldInfo": [{"fieldPath": f["field"], "glossaryTerms": [f["term_urn"]]} for f in op["term_fields"]], + "editableSchemaFieldInfo": [{"fieldPath": f["field"], + "glossaryTerms": {"auditStamp": who, "terms": [{"urn": f["term_urn"]}]}} for f in op["term_fields"]], "created": who, "lastModified": who}) r7 = ("skip", "") if op.get("sensitive_fields"):