wooden-arm-26381
09/27/2021, 3:01 PMgreen-football-43791
09/27/2021, 4:20 PMwooden-arm-26381
09/28/2021, 8:16 AMfields = builder.get_or_add_aspect(
mce, EditableSchemaMetadataClass(editableSchemaFieldInfo=[])
)
And appending every specified field in the recipe in a loop:
fields.editableSchemaFieldInfo.extend(
[
EditableSchemaFieldInfoClass(
field,
description=f"{schema_field[0].description}",
)
]
)
Here is a snippet of the snapshot, in which any changes made to the description of the field “version” should be overwritten with the source content:
SchemaMetadataClass(
{
"schemaName": "...",
"platform": "urn:li:dataPlatform:bigquery",
"version": 0,
"created": AuditStampClass(
{
"time": 0,
"actor": "urn:li:corpuser:unknown",
"impersonator": None,
}
),
"lastModified": AuditStampClass(
{
"time": 0,
"actor": "urn:li:corpuser:unknown",
"impersonator": None,
}
),
"deleted": None,
"dataset": None,
"cluster": None,
"hash": "",
"platformSchema": MySqlDDLClass({"tableSchema": ""}),
"fields": [
SchemaFieldClass(
{
"fieldPath": "id",
"jsonPath": None,
"nullable": True,
"description": None,
"type": SchemaFieldDataTypeClass({"type": NumberTypeClass({})}),
"nativeDataType": "INTEGER",
"recursive": False,
"globalTags": None,
"glossaryTerms": None,
"isPartOfKey": False,
}
),
SchemaFieldClass(
{
"fieldPath": "name",
"jsonPath": None,
"nullable": True,
"description": None,
"type": SchemaFieldDataTypeClass({"type": StringTypeClass({})}),
"nativeDataType": "STRING",
"recursive": False,
"globalTags": None,
"glossaryTerms": None,
"isPartOfKey": False,
}
),
SchemaFieldClass(
{
"fieldPath": "version",
"jsonPath": None,
"nullable": True,
"description": "source information",
"type": SchemaFieldDataTypeClass({"type": NumberTypeClass({})}),
"nativeDataType": "INTEGER",
"recursive": False,
"globalTags": None,
"glossaryTerms": None,
"isPartOfKey": False,
}
),
],
"primaryKeys": None,
"foreignKeysSpecs": None,
}
),
EditableSchemaMetadataClass(
{
"created": AuditStampClass(
{
"time": 0,
"actor": "urn:li:corpuser:unknown",
"impersonator": None,
}
),
"lastModified": AuditStampClass(
{
"time": 0,
"actor": "urn:li:corpuser:unknown",
"impersonator": None,
}
),
"deleted": None,
"editableSchemaFieldInfo": [
EditableSchemaFieldInfoClass(
{
"fieldPath": "version",
"description": "source information",
"globalTags": None,
}
)
],
}
)
green-football-43791
09/28/2021, 4:23 PM