File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -1619,20 +1619,28 @@ def function_score_schema(function_score: FunctionScore) -> schema_types.Functio
16191619 type = ranker .type ,
16201620 description = ranker .description ,
16211621 input_field_names = ranker .input_field_names ,
1622- params = [
1623- common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1624- for k , v in ranker .params .items ()
1625- ],
1622+ params = (
1623+ [
1624+ common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1625+ for k , v in ranker .params .items ()
1626+ ]
1627+ if ranker .params
1628+ else []
1629+ ),
16261630 )
16271631 for ranker in function_score .functions
16281632 ]
16291633
16301634 return schema_types .FunctionScore (
16311635 functions = functions ,
1632- params = [
1633- common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1634- for k , v in function_score .params .items ()
1635- ],
1636+ params = (
1637+ [
1638+ common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1639+ for k , v in function_score .params .items ()
1640+ ]
1641+ if function_score .params
1642+ else []
1643+ ),
16361644 )
16371645
16381646 @staticmethod
You can’t perform that action at this time.
0 commit comments