Skip to content

Commit

Permalink
Fixes #13595 - Consolidate changes by a user in a single session to a…
Browse files Browse the repository at this point in the history
… single change
  • Loading branch information
sureshms committed Nov 17, 2023
1 parent 962cb78 commit 63988ee
Show file tree
Hide file tree
Showing 49 changed files with 986 additions and 1,283 deletions.
501 changes: 0 additions & 501 deletions ingestion/src/metadata/ingestion/ometa/mixins/glossary_mixin.py

This file was deleted.

13 changes: 9 additions & 4 deletions ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""
import json
import traceback
from copy import deepcopy
from typing import Dict, List, Optional, Type, TypeVar, Union

import jsonpatch
Expand Down Expand Up @@ -123,6 +124,12 @@ def patch(self, entity: Type[T], source: T, destination: T) -> Optional[T]:
Updated Entity
"""
try:
# remove change descriptions from entities
if source.changeDescription is not None:
source.changeDescription = None
if destination.changeDescription is not None:
destination.changeDescription = None

# Get the difference between source and destination
patch = jsonpatch.make_patch(
json.loads(source.json(exclude_unset=True, exclude_none=True)),
Expand Down Expand Up @@ -342,12 +349,10 @@ def patch_owner(
)
return None

source.owner = instance.owner

destination = source.copy(deep=True)
destination = deepcopy(instance)
destination.owner = owner

return self.patch(entity=entity, source=source, destination=destination)
return self.patch(entity=entity, source=instance, destination=destination)

def patch_column_tags(
self,
Expand Down
2 changes: 0 additions & 2 deletions ingestion/src/metadata/ingestion/ometa/ometa_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from metadata.ingestion.ometa.mixins.dashboard_mixin import OMetaDashboardMixin
from metadata.ingestion.ometa.mixins.data_insight_mixin import DataInsightMixin
from metadata.ingestion.ometa.mixins.es_mixin import ESMixin
from metadata.ingestion.ometa.mixins.glossary_mixin import GlossaryMixin
from metadata.ingestion.ometa.mixins.ingestion_pipeline_mixin import (
OMetaIngestionPipelineMixin,
)
Expand Down Expand Up @@ -97,7 +96,6 @@ class OpenMetadata(
OMetaTableMixin,
OMetaTopicMixin,
OMetaVersionMixin,
GlossaryMixin,
OMetaServiceMixin,
ESMixin,
OMetaServerMixin,
Expand Down
Loading

0 comments on commit 63988ee

Please sign in to comment.