Skip to content

Commit 25f324e

Browse files
meili-bors[bot]sanders41alallema
authored
Merge #765
765: Allow None for the body when updating settings r=alallema a=sanders41 # Pull Request ## Related issue Fixes the `None` typing issue discussed [here](#762 (comment)) ## What does this PR do? - Allows `None` to be sent in the `body` parameter for settings updates. ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Paul Sanders <[email protected]> Co-authored-by: Amélie <[email protected]>
2 parents 5d51424 + dc33c20 commit 25f324e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

meilisearch/index.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def get_ranking_rules(self) -> List[str]:
858858
"""
859859
return self.http.get(self.__settings_url_for(self.config.paths.ranking_rules))
860860

861-
def update_ranking_rules(self, body: List[str]) -> TaskInfo:
861+
def update_ranking_rules(self, body: Union[List[str], None]) -> TaskInfo:
862862
"""Update ranking rules of the index.
863863
864864
Parameters
@@ -918,7 +918,7 @@ def get_distinct_attribute(self) -> Optional[str]:
918918
"""
919919
return self.http.get(self.__settings_url_for(self.config.paths.distinct_attribute))
920920

921-
def update_distinct_attribute(self, body: Dict[str, Any]) -> TaskInfo:
921+
def update_distinct_attribute(self, body: Union[Dict[str, Any], None]) -> TaskInfo:
922922
"""Update distinct attribute of the index.
923923
924924
Parameters
@@ -978,7 +978,7 @@ def get_searchable_attributes(self) -> List[str]:
978978
"""
979979
return self.http.get(self.__settings_url_for(self.config.paths.searchable_attributes))
980980

981-
def update_searchable_attributes(self, body: List[str]) -> TaskInfo:
981+
def update_searchable_attributes(self, body: Union[List[str], None]) -> TaskInfo:
982982
"""Update searchable attributes of the index.
983983
984984
Parameters
@@ -1038,7 +1038,7 @@ def get_displayed_attributes(self) -> List[str]:
10381038
"""
10391039
return self.http.get(self.__settings_url_for(self.config.paths.displayed_attributes))
10401040

1041-
def update_displayed_attributes(self, body: List[str]) -> TaskInfo:
1041+
def update_displayed_attributes(self, body: Union[List[str], None]) -> TaskInfo:
10421042
"""Update displayed attributes of the index.
10431043
10441044
Parameters
@@ -1098,7 +1098,7 @@ def get_stop_words(self) -> List[str]:
10981098
"""
10991099
return self.http.get(self.__settings_url_for(self.config.paths.stop_words))
11001100

1101-
def update_stop_words(self, body: List[str]) -> TaskInfo:
1101+
def update_stop_words(self, body: Union[List[str], None]) -> TaskInfo:
11021102
"""Update stop words of the index.
11031103
11041104
Parameters
@@ -1158,7 +1158,7 @@ def get_synonyms(self) -> Dict[str, List[str]]:
11581158
"""
11591159
return self.http.get(self.__settings_url_for(self.config.paths.synonyms))
11601160

1161-
def update_synonyms(self, body: Dict[str, List[str]]) -> TaskInfo:
1161+
def update_synonyms(self, body: Union[Dict[str, List[str]], None]) -> TaskInfo:
11621162
"""Update synonyms of the index.
11631163
11641164
Parameters
@@ -1218,7 +1218,7 @@ def get_filterable_attributes(self) -> List[str]:
12181218
"""
12191219
return self.http.get(self.__settings_url_for(self.config.paths.filterable_attributes))
12201220

1221-
def update_filterable_attributes(self, body: List[str]) -> TaskInfo:
1221+
def update_filterable_attributes(self, body: Union[List[str], None]) -> TaskInfo:
12221222
"""Update filterable attributes of the index.
12231223
12241224
Parameters
@@ -1278,7 +1278,7 @@ def get_sortable_attributes(self) -> List[str]:
12781278
"""
12791279
return self.http.get(self.__settings_url_for(self.config.paths.sortable_attributes))
12801280

1281-
def update_sortable_attributes(self, body: List[str]) -> TaskInfo:
1281+
def update_sortable_attributes(self, body: Union[List[str], None]) -> TaskInfo:
12821282
"""Update sortable attributes of the index.
12831283
12841284
Parameters
@@ -1340,7 +1340,7 @@ def get_typo_tolerance(self) -> TypoTolerance:
13401340

13411341
return TypoTolerance(**typo_tolerance)
13421342

1343-
def update_typo_tolerance(self, body: Dict[str, Any]) -> TaskInfo:
1343+
def update_typo_tolerance(self, body: Union[Dict[str, Any], None]) -> TaskInfo:
13441344
"""Update typo tolerance of the index.
13451345
13461346
Parameters
@@ -1400,7 +1400,7 @@ def get_pagination_settings(self) -> Pagination:
14001400

14011401
return Pagination(**pagination)
14021402

1403-
def update_pagination_settings(self, body: Dict[str, Any]) -> TaskInfo:
1403+
def update_pagination_settings(self, body: Union[Dict[str, Any], None]) -> TaskInfo:
14041404
"""Update the pagination settings of the index.
14051405
14061406
Parameters
@@ -1462,7 +1462,7 @@ def get_faceting_settings(self) -> Faceting:
14621462

14631463
return Faceting(**faceting)
14641464

1465-
def update_faceting_settings(self, body: Dict[str, Any]) -> TaskInfo:
1465+
def update_faceting_settings(self, body: Union[Dict[str, Any], None]) -> TaskInfo:
14661466
"""Update the faceting settings of the index.
14671467
14681468
Parameters

0 commit comments

Comments
 (0)