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 @@ -1634,20 +1634,28 @@ def function_score_schema(function_score: FunctionScore) -> schema_types.Functio
16341634 type = ranker .type ,
16351635 description = ranker .description ,
16361636 input_field_names = ranker .input_field_names ,
1637- params = [
1638- common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1639- for k , v in ranker .params .items ()
1640- ],
1637+ params = (
1638+ [
1639+ common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1640+ for k , v in ranker .params .items ()
1641+ ]
1642+ if ranker .params
1643+ else []
1644+ ),
16411645 )
16421646 for ranker in function_score .functions
16431647 ]
16441648
16451649 return schema_types .FunctionScore (
16461650 functions = functions ,
1647- params = [
1648- common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1649- for k , v in function_score .params .items ()
1650- ],
1651+ params = (
1652+ [
1653+ common_types .KeyValuePair (key = str (k ), value = Prepare .common_kv_value (v ))
1654+ for k , v in function_score .params .items ()
1655+ ]
1656+ if function_score .params
1657+ else []
1658+ ),
16511659 )
16521660
16531661 @staticmethod
You can’t perform that action at this time.
0 commit comments