fix(transformer): fix invalid lastModified.actor entry in transformers (#5906)

This commit is contained in:
Mayuri Nehate 2022-09-14 22:29:17 +05:30 committed by GitHub
parent a1e1d2fd0a
commit 8ead62dae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -15,7 +15,6 @@ from datahub.ingestion.transformer.dataset_transformer import (
DatasetOwnershipTransformer,
)
from datahub.metadata.schema_classes import (
AuditStampClass,
OwnerClass,
OwnershipClass,
OwnershipTypeClass,
@ -103,7 +102,7 @@ class AddDatasetOwnership(DatasetOwnershipTransformer):
owners=[],
lastModified=in_ownership_aspect.lastModified
if in_ownership_aspect is not None
else AuditStampClass.construct_with_defaults(),
else None,
)
# Check if user want to keep existing ownerships

View File

@ -80,7 +80,9 @@ class AddDatasetSchemaTerms(DatasetSchemaMetadataTransformer):
terms=[],
auditStamp=schema_field.glossaryTerms.auditStamp
if schema_field.glossaryTerms is not None
else AuditStampClass.construct_with_defaults(),
else AuditStampClass(
time=builder.get_sys_time(), actor="urn:li:corpUser:restEmitter"
),
)
new_glossary_term.terms.extend(terms_to_add)
new_glossary_term.terms.extend(server_terms)

View File

@ -1,6 +1,7 @@
import logging
from typing import Callable, List, Optional, Union, cast
import datahub.emitter.mce_builder as builder
from datahub.configuration.common import (
KeyValuePattern,
TransformerSemantics,
@ -91,7 +92,9 @@ class AddDatasetTerms(DatasetTermsTransformer):
terms=[],
auditStamp=in_glossary_terms.auditStamp
if in_glossary_terms is not None
else AuditStampClass.construct_with_defaults(),
else AuditStampClass(
time=builder.get_sys_time(), actor="urn:li:corpUser:restEmitter"
),
)
# Check if user want to keep existing terms
if in_glossary_terms is not None and self.config.replace_existing is False: