From 732a45bb7aea6b022166e71773695a3faa7fac01 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 16 Jul 2020 11:36:47 -0700 Subject: [PATCH 1/3] fix pylint issue --- .../azure/search/documents/indexes/_internal/_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py index fe3722a8e75d..4240763a04ca 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py @@ -75,7 +75,7 @@ def prep_if_none_match(etag, match_condition): return None -def pack_custom_analyzer(custom_analyzer): +def pack_custom_analyzer(custom_analyzer, **kwargs): # pylint: disable=unused-argument # type: (CustomAnalyzer) -> _CustomAnalyzer return _CustomAnalyzer( odata_type=custom_analyzer.odata_type, @@ -85,7 +85,7 @@ def pack_custom_analyzer(custom_analyzer): ) -def unpack_custom_analyzer(custom_analyzer): +def unpack_custom_analyzer(custom_analyzer, **kwargs): # pylint: disable=unused-argument # type: (_CustomAnalyzer) -> CustomAnalyzer return _CustomAnalyzer( odata_type=custom_analyzer.odata_type, From c6d69ffb9e711e43ed3125d04eaf44bac2267c2c Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 16 Jul 2020 12:35:39 -0700 Subject: [PATCH 2/3] fix pylint issue --- .../azure/search/documents/indexes/_internal/_utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py index 4240763a04ca..08b29f1615be 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py @@ -75,9 +75,10 @@ def prep_if_none_match(etag, match_condition): return None -def pack_custom_analyzer(custom_analyzer, **kwargs): # pylint: disable=unused-argument +def pack_custom_analyzer(custom_analyzer): # type: (CustomAnalyzer) -> _CustomAnalyzer return _CustomAnalyzer( + name=custom_analyzer.name, odata_type=custom_analyzer.odata_type, tokenizer=custom_analyzer.tokenizer_name, token_filters=custom_analyzer.token_filters, @@ -85,10 +86,12 @@ def pack_custom_analyzer(custom_analyzer, **kwargs): # pylint: disable=unused ) -def unpack_custom_analyzer(custom_analyzer, **kwargs): # pylint: disable=unused-argument +def unpack_custom_analyzer(custom_analyzer): # type: (_CustomAnalyzer) -> CustomAnalyzer - return _CustomAnalyzer( + return CustomAnalyzer( + name=custom_analyzer.name, odata_type=custom_analyzer.odata_type, + tokenizer=custom_analyzer.tokenizer, tokenizer_name=custom_analyzer.tokenizer, token_filters=custom_analyzer.token_filters, char_filters=custom_analyzer.char_filters From 56da2133545f83b7a6407b7d3080143fd33048f3 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 16 Jul 2020 12:47:54 -0700 Subject: [PATCH 3/3] update --- .../azure/search/documents/indexes/_internal/_models.py | 2 +- .../azure/search/documents/indexes/_internal/_utils.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py index bfdbc1701aa8..7da916d21bdb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py @@ -119,7 +119,7 @@ class CustomAnalyzer(LexicalAnalyzer): _validation = { 'odata_type': {'required': True}, 'name': {'required': True}, - 'tokenizer': {'required': True}, + 'tokenizer_name': {'required': True}, } _attribute_map = { diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py index 08b29f1615be..9ad43085cd07 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py @@ -91,7 +91,6 @@ def unpack_custom_analyzer(custom_analyzer): return CustomAnalyzer( name=custom_analyzer.name, odata_type=custom_analyzer.odata_type, - tokenizer=custom_analyzer.tokenizer, tokenizer_name=custom_analyzer.tokenizer, token_filters=custom_analyzer.token_filters, char_filters=custom_analyzer.char_filters