Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #13595 Consolidate changes by a user in a single session to a single change #13617

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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