Skip to content

Commit 5cf20b1

Browse files
authored
Some doc fixes (#38872)
* Some doc fixes * Update sdk/search/azure-search-documents/azure/search/documents/_generated/_serialization.py * Update sdk/search/azure-search-documents/azure/search/documents/_generated/_serialization.py * Update sdk/search/azure-search-documents/azure/search/documents/_generated/_serialization.py
1 parent fc65faa commit 5cf20b1

File tree

16 files changed

+246
-224
lines changed

16 files changed

+246
-224
lines changed

sdk/search/azure-search-documents/azure/search/documents/_generated/_serialization.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
456456
:param str data: A str using RestAPI structure. JSON by default.
457457
:param str content_type: JSON by default, set application/xml if XML.
458458
:returns: An instance of this model
459-
:raises: DeserializationError if something went wrong
459+
:raises DeserializationError: if something went wrong
460460
:rtype: ModelType
461461
"""
462462
deserializer = Deserializer(cls._infer_class_models())
@@ -479,7 +479,7 @@ def from_dict(
479479
:param function key_extractors: A key extractor function.
480480
:param str content_type: JSON by default, set application/xml if XML.
481481
:returns: An instance of this model
482-
:raises: DeserializationError if something went wrong
482+
:raises DeserializationError: if something went wrong
483483
:rtype: ModelType
484484
"""
485485
deserializer = Deserializer(cls._infer_class_models())
@@ -626,7 +626,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to
626626
:param object target_obj: The data to be serialized.
627627
:param str data_type: The type to be serialized from.
628628
:rtype: str, dict
629-
:raises: SerializationError if serialization fails.
629+
:raises SerializationError: if serialization fails.
630630
:returns: The serialized data.
631631
"""
632632
key_transformer = kwargs.get("key_transformer", self.key_transformer)
@@ -736,8 +736,8 @@ def body(self, data, data_type, **kwargs):
736736
:param object data: The data to be serialized.
737737
:param str data_type: The type to be serialized from.
738738
:rtype: dict
739-
:raises: SerializationError if serialization fails.
740-
:raises: ValueError if data is None
739+
:raises SerializationError: if serialization fails.
740+
:raises ValueError: if data is None
741741
:returns: The serialized request body
742742
"""
743743

@@ -781,8 +781,8 @@ def url(self, name, data, data_type, **kwargs):
781781
:param str data_type: The type to be serialized from.
782782
:rtype: str
783783
:returns: The serialized URL path
784-
:raises: TypeError if serialization fails.
785-
:raises: ValueError if data is None
784+
:raises TypeError: if serialization fails.
785+
:raises ValueError: if data is None
786786
"""
787787
try:
788788
output = self.serialize_data(data, data_type, **kwargs)
@@ -805,8 +805,8 @@ def query(self, name, data, data_type, **kwargs):
805805
:param object data: The data to be serialized.
806806
:param str data_type: The type to be serialized from.
807807
:rtype: str, list
808-
:raises: TypeError if serialization fails.
809-
:raises: ValueError if data is None
808+
:raises TypeError: if serialization fails.
809+
:raises ValueError: if data is None
810810
:returns: The serialized query parameter
811811
"""
812812
try:
@@ -835,8 +835,8 @@ def header(self, name, data, data_type, **kwargs):
835835
:param object data: The data to be serialized.
836836
:param str data_type: The type to be serialized from.
837837
:rtype: str
838-
:raises: TypeError if serialization fails.
839-
:raises: ValueError if data is None
838+
:raises TypeError: if serialization fails.
839+
:raises ValueError: if data is None
840840
:returns: The serialized header
841841
"""
842842
try:
@@ -855,9 +855,9 @@ def serialize_data(self, data, data_type, **kwargs):
855855
856856
:param object data: The data to be serialized.
857857
:param str data_type: The type to be serialized from.
858-
:raises: AttributeError if required data is None.
859-
:raises: ValueError if data is None
860-
:raises: SerializationError if serialization fails.
858+
:raises AttributeError: if required data is None.
859+
:raises ValueError: if data is None
860+
:raises SerializationError: if serialization fails.
861861
:returns: The serialized data.
862862
:rtype: str, int, float, bool, dict, list
863863
"""
@@ -1192,7 +1192,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
11921192
11931193
:param Datetime attr: Object to be serialized.
11941194
:rtype: str
1195-
:raises: TypeError if format invalid.
1195+
:raises TypeError: if format invalid.
11961196
:return: serialized rfc
11971197
"""
11981198
try:
@@ -1218,7 +1218,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
12181218
12191219
:param Datetime attr: Object to be serialized.
12201220
:rtype: str
1221-
:raises: SerializationError if format invalid.
1221+
:raises SerializationError: if format invalid.
12221222
:return: serialized iso
12231223
"""
12241224
if isinstance(attr, str):
@@ -1251,7 +1251,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
12511251
12521252
:param Datetime attr: Object to be serialized.
12531253
:rtype: int
1254-
:raises: SerializationError if format invalid
1254+
:raises SerializationError: if format invalid
12551255
:return: serialied unix
12561256
"""
12571257
if isinstance(attr, int):
@@ -1488,7 +1488,7 @@ def __call__(self, target_obj, response_data, content_type=None):
14881488
:param str target_obj: Target data type to deserialize to.
14891489
:param requests.Response response_data: REST response object.
14901490
:param str content_type: Swagger "produces" if available.
1491-
:raises: DeserializationError if deserialization fails.
1491+
:raises DeserializationError: if deserialization fails.
14921492
:return: Deserialized object.
14931493
:rtype: object
14941494
"""
@@ -1502,7 +1502,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return
15021502
15031503
:param str target_obj: Target data type to deserialize to.
15041504
:param object data: Object to deserialize.
1505-
:raises: DeserializationError if deserialization fails.
1505+
:raises DeserializationError: if deserialization fails.
15061506
:return: Deserialized object.
15071507
:rtype: object
15081508
"""
@@ -1713,7 +1713,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-
17131713
17141714
:param str data: The response string to be deserialized.
17151715
:param str data_type: The type to deserialize to.
1716-
:raises: DeserializationError if deserialization fails.
1716+
:raises DeserializationError: if deserialization fails.
17171717
:return: Deserialized object.
17181718
:rtype: object
17191719
"""
@@ -1795,7 +1795,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return
17951795
:param dict attr: Dictionary to be deserialized.
17961796
:return: Deserialized object.
17971797
:rtype: dict
1798-
:raises: TypeError if non-builtin datatype encountered.
1798+
:raises TypeError: if non-builtin datatype encountered.
17991799
"""
18001800
if attr is None:
18011801
return None
@@ -1841,7 +1841,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return
18411841
:param str data_type: deserialization data type.
18421842
:return: Deserialized basic type.
18431843
:rtype: str, int, float or bool
1844-
:raises: TypeError if string format is not valid.
1844+
:raises TypeError: if string format is not valid.
18451845
"""
18461846
# If we're here, data is supposed to be a basic type.
18471847
# If it's still an XML node, take the text
@@ -1932,7 +1932,7 @@ def deserialize_bytearray(attr):
19321932
:param str attr: response string to be deserialized.
19331933
:return: Deserialized bytearray
19341934
:rtype: bytearray
1935-
:raises: TypeError if string format invalid.
1935+
:raises TypeError: if string format invalid.
19361936
"""
19371937
if isinstance(attr, ET.Element):
19381938
attr = attr.text
@@ -1945,7 +1945,7 @@ def deserialize_base64(attr):
19451945
:param str attr: response string to be deserialized.
19461946
:return: Deserialized base64 string
19471947
:rtype: bytearray
1948-
:raises: TypeError if string format invalid.
1948+
:raises TypeError: if string format invalid.
19491949
"""
19501950
if isinstance(attr, ET.Element):
19511951
attr = attr.text
@@ -1960,7 +1960,7 @@ def deserialize_decimal(attr):
19601960
19611961
:param str attr: response string to be deserialized.
19621962
:return: Deserialized decimal
1963-
:raises: DeserializationError if string format invalid.
1963+
:raises DeserializationError: if string format invalid.
19641964
:rtype: decimal
19651965
"""
19661966
if isinstance(attr, ET.Element):
@@ -1978,7 +1978,7 @@ def deserialize_long(attr):
19781978
:param str attr: response string to be deserialized.
19791979
:return: Deserialized int
19801980
:rtype: long or int
1981-
:raises: ValueError if string format invalid.
1981+
:raises ValueError: if string format invalid.
19821982
"""
19831983
if isinstance(attr, ET.Element):
19841984
attr = attr.text
@@ -1991,7 +1991,7 @@ def deserialize_duration(attr):
19911991
:param str attr: response string to be deserialized.
19921992
:return: Deserialized duration
19931993
:rtype: TimeDelta
1994-
:raises: DeserializationError if string format invalid.
1994+
:raises DeserializationError: if string format invalid.
19951995
"""
19961996
if isinstance(attr, ET.Element):
19971997
attr = attr.text
@@ -2009,7 +2009,7 @@ def deserialize_date(attr):
20092009
:param str attr: response string to be deserialized.
20102010
:return: Deserialized date
20112011
:rtype: Date
2012-
:raises: DeserializationError if string format invalid.
2012+
:raises DeserializationError: if string format invalid.
20132013
"""
20142014
if isinstance(attr, ET.Element):
20152015
attr = attr.text
@@ -2025,7 +2025,7 @@ def deserialize_time(attr):
20252025
:param str attr: response string to be deserialized.
20262026
:return: Deserialized time
20272027
:rtype: datetime.time
2028-
:raises: DeserializationError if string format invalid.
2028+
:raises DeserializationError: if string format invalid.
20292029
"""
20302030
if isinstance(attr, ET.Element):
20312031
attr = attr.text
@@ -2040,7 +2040,7 @@ def deserialize_rfc(attr):
20402040
:param str attr: response string to be deserialized.
20412041
:return: Deserialized RFC datetime
20422042
:rtype: Datetime
2043-
:raises: DeserializationError if string format invalid.
2043+
:raises DeserializationError: if string format invalid.
20442044
"""
20452045
if isinstance(attr, ET.Element):
20462046
attr = attr.text
@@ -2063,7 +2063,7 @@ def deserialize_iso(attr):
20632063
:param str attr: response string to be deserialized.
20642064
:return: Deserialized ISO datetime
20652065
:rtype: Datetime
2066-
:raises: DeserializationError if string format invalid.
2066+
:raises DeserializationError: if string format invalid.
20672067
"""
20682068
if isinstance(attr, ET.Element):
20692069
attr = attr.text
@@ -2101,7 +2101,7 @@ def deserialize_unix(attr):
21012101
:param int attr: Object to be serialized.
21022102
:return: Deserialized datetime
21032103
:rtype: Datetime
2104-
:raises: DeserializationError if format invalid
2104+
:raises DeserializationError: if format invalid
21052105
"""
21062106
if isinstance(attr, ET.Element):
21072107
attr = int(attr.text) # type: ignore

sdk/search/azure-search-documents/azure/search/documents/_paging.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def unpack_continuation_token(token):
4343

4444

4545
class SearchItemPaged(ItemPaged[ReturnType]):
46+
"""A pageable list of search results."""
4647
def __init__(self, *args, **kwargs) -> None:
4748
super(SearchItemPaged, self).__init__(*args, **kwargs)
4849
self._first_page_iterator_instance: Optional[SearchPageIterator] = None
@@ -116,6 +117,7 @@ def wrapper(self, *args, **kw):
116117

117118

118119
class SearchPageIterator(PageIterator):
120+
"""An iterator over search results."""
119121
def __init__(self, client, initial_query, kwargs, continuation_token=None) -> None:
120122
super(SearchPageIterator, self).__init__(
121123
get_next=self._get_next_cb,

sdk/search/azure-search-documents/azure/search/documents/_queries.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ def order_by(self, *fields: Union[str, List[str]]) -> None:
5858
5959
:param fields: A list of fields for the query result to be ordered by.
6060
:type fields: str or list[str]
61-
:raises: ValueError
61+
:raises ValueError: If no fields are provided.
6262
"""
63-
if not fields:
64-
raise ValueError("At least one field must be provided")
6563
if not fields:
6664
raise ValueError("At least one field must be provided")
6765
selects = []
@@ -78,7 +76,7 @@ def select(self, *fields: Union[str, List[str]]) -> None:
7876
7977
:param fields: A list of fields for the query result to return.
8078
:type fields: str or list[str]
81-
:raises: ValueError
79+
:raises ValueError: If no fields are provided.
8280
"""
8381
if not fields:
8482
raise ValueError("At least one field must be provided")
@@ -104,10 +102,8 @@ def order_by(self, *fields: Union[str, List[str]]) -> None:
104102
105103
:param fields: A list of fields for the query result to be ordered by.
106104
:type fields: str or list[str]
107-
:raises: ValueError
105+
:raises ValueError: If no fields are provided.
108106
"""
109-
if not fields:
110-
raise ValueError("At least one field must be provided")
111107
if not fields:
112108
raise ValueError("At least one field must be provided")
113109
selects = []
@@ -124,7 +120,7 @@ def select(self, *fields: Union[str, List[str]]) -> None:
124120
125121
:param fields: A list of fields for the query result to return.
126122
:type fields: str or list[str]
127-
:raises: ValueError
123+
:raises ValueError: If no fields are provided.
128124
"""
129125
if not fields:
130126
raise ValueError("At least one field must be provided")

sdk/search/azure-search-documents/azure/search/documents/_search_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def __repr__(self) -> str:
101101

102102
def close(self) -> None:
103103
"""Close the session.
104+
104105
:return: None
105106
:rtype: None
106107
"""

sdk/search/azure-search-documents/azure/search/documents/_search_indexing_buffered_sender.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def actions(self) -> List[IndexAction]:
111111
@distributed_trace
112112
def close(self, **kwargs) -> None: # pylint: disable=unused-argument
113113
"""Close the session.
114+
114115
:return: None
115116
:rtype: None
116117
"""

sdk/search/azure-search-documents/azure/search/documents/aio/_paging.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818

1919
class AsyncSearchItemPaged(AsyncItemPaged[ReturnType]):
20+
"""A pageable list of search results."""
2021
def __init__(self, *args, **kwargs) -> None:
2122
super(AsyncSearchItemPaged, self).__init__(*args, **kwargs)
2223
self._first_page_iterator_instance: Optional[AsyncSearchPageIterator] = None
@@ -99,6 +100,7 @@ async def wrapper(self, *args, **kw):
99100

100101

101102
class AsyncSearchPageIterator(AsyncPageIterator[ReturnType]):
103+
"""An iterator of search results."""
102104
def __init__(self, client, initial_query, kwargs, continuation_token=None) -> None:
103105
super(AsyncSearchPageIterator, self).__init__(
104106
get_next=self._get_next_cb,

sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def __repr__(self) -> str:
103103

104104
async def close(self) -> None:
105105
"""Close the session.
106+
106107
:return: None
107108
:rtype: None
108109
"""

0 commit comments

Comments
 (0)