Skip to content

Commit

Permalink
chore(ingest/presto-on-hive) Set enable_properties_merge to True by d…
Browse files Browse the repository at this point in the history
  • Loading branch information
dushayntAW authored and sleeperdeep committed Jun 25, 2024
1 parent d461357 commit 7531415
Show file tree
Hide file tree
Showing 9 changed files with 2,328 additions and 644 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class HiveMetastore(BasicSQLAlchemyConfig):
)

enable_properties_merge: bool = Field(
default=False,
description="By default, the connector overwrites properties every time. Set this to True to enable merging of properties with what exists on the server.",
default=True,
description="By default, the connector enables merging of properties with what exists on the server. Set this to False to enable the default connector behavior of overwriting properties on each ingestion.",
)

simplify_nested_field_paths: bool = Field(
Expand Down
12 changes: 12 additions & 0 deletions metadata-ingestion/src/datahub/testing/compare_metadata_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import pathlib
import pprint
import re
import shutil
import tempfile
from typing import Any, Dict, List, Sequence, Union
Expand Down Expand Up @@ -40,6 +41,7 @@ def assert_metadata_files_equal(
update_golden: bool,
copy_output: bool,
ignore_paths: Sequence[str] = (),
ignore_paths_v2: Sequence[str] = (),
ignore_order: bool = True,
) -> None:
golden_exists = os.path.isfile(golden_path)
Expand Down Expand Up @@ -70,6 +72,16 @@ def assert_metadata_files_equal(
logger.info(f"Error reformatting golden file as MCP/MCEs: {e}")
golden = load_json_file(golden_path)

if ignore_paths_v2:
golden_json = load_json_file(golden_path)
for i, obj in enumerate(golden_json):
aspect_json = obj.get("aspect", {}).get("json", [])
for j, item in enumerate(aspect_json):
if isinstance(item, dict):
if item.get("path") in ignore_paths_v2:
json_path = f"root[{i}]['aspect']['json'][{j}]['value']"
ignore_paths = (*ignore_paths, re.escape(json_path))

diff = diff_metadata_json(output, golden, ignore_paths, ignore_order=ignore_order)
if diff and update_golden:
if isinstance(diff, MCPDiff):
Expand Down
Loading

0 comments on commit 7531415

Please sign in to comment.