Skip to content

Allow None for the body when updating settings #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions meilisearch/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ def get_ranking_rules(self) -> List[str]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.ranking_rules))

def update_ranking_rules(self, body: List[str]) -> TaskInfo:
def update_ranking_rules(self, body: Union[List[str], None]) -> TaskInfo:
"""Update ranking rules of the index.

Parameters
Expand Down Expand Up @@ -918,7 +918,7 @@ def get_distinct_attribute(self) -> Optional[str]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.distinct_attribute))

def update_distinct_attribute(self, body: Dict[str, Any]) -> TaskInfo:
def update_distinct_attribute(self, body: Union[Dict[str, Any], None]) -> TaskInfo:
"""Update distinct attribute of the index.

Parameters
Expand Down Expand Up @@ -978,7 +978,7 @@ def get_searchable_attributes(self) -> List[str]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.searchable_attributes))

def update_searchable_attributes(self, body: List[str]) -> TaskInfo:
def update_searchable_attributes(self, body: Union[List[str], None]) -> TaskInfo:
"""Update searchable attributes of the index.

Parameters
Expand Down Expand Up @@ -1038,7 +1038,7 @@ def get_displayed_attributes(self) -> List[str]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.displayed_attributes))

def update_displayed_attributes(self, body: List[str]) -> TaskInfo:
def update_displayed_attributes(self, body: Union[List[str], None]) -> TaskInfo:
"""Update displayed attributes of the index.

Parameters
Expand Down Expand Up @@ -1098,7 +1098,7 @@ def get_stop_words(self) -> List[str]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.stop_words))

def update_stop_words(self, body: List[str]) -> TaskInfo:
def update_stop_words(self, body: Union[List[str], None]) -> TaskInfo:
"""Update stop words of the index.

Parameters
Expand Down Expand Up @@ -1158,7 +1158,7 @@ def get_synonyms(self) -> Dict[str, List[str]]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.synonyms))

def update_synonyms(self, body: Dict[str, List[str]]) -> TaskInfo:
def update_synonyms(self, body: Union[Dict[str, List[str]], None]) -> TaskInfo:
"""Update synonyms of the index.

Parameters
Expand Down Expand Up @@ -1218,7 +1218,7 @@ def get_filterable_attributes(self) -> List[str]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.filterable_attributes))

def update_filterable_attributes(self, body: List[str]) -> TaskInfo:
def update_filterable_attributes(self, body: Union[List[str], None]) -> TaskInfo:
"""Update filterable attributes of the index.

Parameters
Expand Down Expand Up @@ -1278,7 +1278,7 @@ def get_sortable_attributes(self) -> List[str]:
"""
return self.http.get(self.__settings_url_for(self.config.paths.sortable_attributes))

def update_sortable_attributes(self, body: List[str]) -> TaskInfo:
def update_sortable_attributes(self, body: Union[List[str], None]) -> TaskInfo:
"""Update sortable attributes of the index.

Parameters
Expand Down Expand Up @@ -1340,7 +1340,7 @@ def get_typo_tolerance(self) -> TypoTolerance:

return TypoTolerance(**typo_tolerance)

def update_typo_tolerance(self, body: Dict[str, Any]) -> TaskInfo:
def update_typo_tolerance(self, body: Union[Dict[str, Any], None]) -> TaskInfo:
"""Update typo tolerance of the index.

Parameters
Expand Down Expand Up @@ -1400,7 +1400,7 @@ def get_pagination_settings(self) -> Pagination:

return Pagination(**pagination)

def update_pagination_settings(self, body: Dict[str, Any]) -> TaskInfo:
def update_pagination_settings(self, body: Union[Dict[str, Any], None]) -> TaskInfo:
"""Update the pagination settings of the index.

Parameters
Expand Down Expand Up @@ -1462,7 +1462,7 @@ def get_faceting_settings(self) -> Faceting:

return Faceting(**faceting)

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

Parameters
Expand Down