mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-13 01:38:13 +00:00

* feat(statistics-profiler): use statistics tables to profile trino tables - implemented the collaborative root class - added the "useStatistics" profiler parameter - added the "supportsStatistics" database connection property - implemented the ProfilerWithStatistics and StoredStatisticsSource to add this functionality to specific profilers - implemented TrinoStoredStatisticsSource for specific trino statistics logic * added ABC to terminal classes in collaborative root * fixed docstring for TestSuiteInterface * reverted unintended changes * typo
24 lines
799 B
Python
24 lines
799 B
Python
def merge(source: dict, destination: dict):
|
|
"""
|
|
Merge source dictionary into destination dictionary recursively in place.
|
|
|
|
Examples
|
|
# >>> a = { 'first' : { 'all_rows' : { 'pass' : 'dog', 'number' : '1' } } }
|
|
# >>> b = { 'first' : { 'all_rows' : { 'fail' : 'cat', 'number' : '5' } } }
|
|
# >>> merge(b, a) == { 'first' : { 'all_rows' : { 'pass' : 'dog', 'fail' : 'cat', 'number' : '5' } } }
|
|
True
|
|
|
|
Args:
|
|
source (dict): Source dictionary
|
|
destination (dict): Destination dictionary
|
|
"""
|
|
for key, value in source.items():
|
|
if isinstance(value, dict):
|
|
# get node or create one
|
|
node = destination.setdefault(key, {})
|
|
merge(value, node)
|
|
else:
|
|
destination[key] = value
|
|
|
|
return destination
|