From 33e32942b3deeb8cf4ff2cae20f71a5a9d264e76 Mon Sep 17 00:00:00 2001 From: Tony Ouyang Date: Fri, 12 Jan 2024 10:03:19 -0800 Subject: [PATCH] fix(ingest/mongodb): Fix downsampling the collection schema output undetermined (#9612) --- metadata-ingestion/src/datahub/ingestion/source/mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/mongodb.py b/metadata-ingestion/src/datahub/ingestion/source/mongodb.py index 577da91ee82da9..e30e16e774cd5a 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/mongodb.py +++ b/metadata-ingestion/src/datahub/ingestion/source/mongodb.py @@ -421,7 +421,7 @@ def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: ) collection_fields = sorted( collection_schema.values(), - key=lambda x: x["count"], + key=lambda x: (x["count"], x["delimited_name"]), reverse=True, )[0:max_schema_size] # Add this information to the custom properties so user can know they are looking at downsampled schema