File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
elasticsearch/stac_fastapi/elasticsearch
opensearch/stac_fastapi/opensearch Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -916,7 +916,13 @@ async def get_items_unique_values(
916916 result : Dict [str , List [str ]] = {}
917917 for field , agg in query ["aggregations" ].items ():
918918 if len (agg ["buckets" ]) > limit :
919- raise ValueError (f"Field { field } has more than { limit } unique values." )
919+ logger .warning (
920+ "Skipping enum field %s: exceeds limit of %d unique values. "
921+ "Consider excluding this field from enumeration or increase the limit." ,
922+ field ,
923+ limit ,
924+ )
925+ continue
920926 result [field ] = [bucket ["key" ] for bucket in agg ["buckets" ]]
921927 return result
922928
Original file line number Diff line number Diff line change @@ -925,7 +925,13 @@ async def get_items_unique_values(
925925 result : Dict [str , List [str ]] = {}
926926 for field , agg in query ["aggregations" ].items ():
927927 if len (agg ["buckets" ]) > limit :
928- raise ValueError (f"Field { field } has more than { limit } unique values." )
928+ logger .warning (
929+ "Skipping enum field %s: exceeds limit of %d unique values. "
930+ "Consider excluding this field from enumeration or increase the limit." ,
931+ field ,
932+ limit ,
933+ )
934+ continue
929935 result [field ] = [bucket ["key" ] for bucket in agg ["buckets" ]]
930936 return result
931937
You can’t perform that action at this time.
0 commit comments