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(
916
916
result : Dict [str , List [str ]] = {}
917
917
for field , agg in query ["aggregations" ].items ():
918
918
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
920
926
result [field ] = [bucket ["key" ] for bucket in agg ["buckets" ]]
921
927
return result
922
928
Original file line number Diff line number Diff line change @@ -925,7 +925,13 @@ async def get_items_unique_values(
925
925
result : Dict [str , List [str ]] = {}
926
926
for field , agg in query ["aggregations" ].items ():
927
927
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
929
935
result [field ] = [bucket ["key" ] for bucket in agg ["buckets" ]]
930
936
return result
931
937
You can’t perform that action at this time.
0 commit comments