Skip to content

Commit 1701522

Browse files
authored
Fix Sphinx error in core (#32417)
* Fix Sphinx error in core * Mode Sphinx update * Fix all Sphinx issues
1 parent d59c895 commit 1701522

File tree

7 files changed

+31
-48
lines changed

7 files changed

+31
-48
lines changed

sdk/core/azure-core/azure/core/exceptions.py

+21-17
Original file line numberDiff line numberDiff line change
@@ -172,25 +172,29 @@ class ODataV4Format:
172172
173173
Example of JSON:
174174
175-
error: {
176-
"code": "ValidationError",
177-
"message": "One or more fields contain incorrect values: ",
178-
"details": [
179-
{
180-
"code": "ValidationError",
181-
"target": "representation",
182-
"message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\\\\d+)?$'.
183-
Path 'host', line 1, position 297."
184-
},
185-
{
175+
.. code-block:: json
176+
177+
{
178+
"error": {
186179
"code": "ValidationError",
187-
"target": "representation",
188-
"message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate
189-
https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
190-
(schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)."
180+
"message": "One or more fields contain incorrect values: ",
181+
"details": [
182+
{
183+
"code": "ValidationError",
184+
"target": "representation",
185+
"message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\\\\d+)?$'.
186+
Path 'host', line 1, position 297."
187+
},
188+
{
189+
"code": "ValidationError",
190+
"target": "representation",
191+
"message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate
192+
https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
193+
(schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)."
194+
}
195+
]
191196
}
192-
]
193-
}
197+
}
194198
195199
:param dict json_object: A Python dict representing a ODataV4 JSON
196200
:ivar str ~.code: Its value is a service-defined error code.

sdk/core/azure-core/azure/core/messaging.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def from_dict(cls, event: Dict[str, Any]) -> CloudEvent[DataType]:
216216

217217
@classmethod
218218
def from_json(cls, event: Any) -> CloudEvent[DataType]:
219-
"""
220-
Returns the deserialized CloudEvent object when a json payload is provided.
219+
"""Returns the deserialized CloudEvent object when a json payload is provided.
220+
221221
:param event: The json string that should be converted into a CloudEvent. This can also be
222222
a storage QueueMessage, eventhub's EventData or ServiceBusMessage
223223
:type event: object

sdk/core/azure-core/azure/core/pipeline/policies/_base.py

-8
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,6 @@ def on_exception(
110110
111111
:param request: The Pipeline request object
112112
:type request: ~azure.core.pipeline.PipelineRequest
113-
114-
.. admonition:: Example:
115-
116-
.. literalinclude:: ../samples/test_example_sansio.py
117-
:start-after: [START on_exception]
118-
:end-before: [END on_exception]
119-
:language: python
120-
:dedent: 4
121113
"""
122114
return
123115

sdk/core/azure-core/azure/core/tracing/_abstract_span.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def set_http_attributes(self, request: HttpRequestType, response: Optional[HttpR
144144
Add correct attributes for a http client span.
145145
146146
:param request: The request made
147-
:type request: HttpRequest
147+
:type request: azure.core.rest.HttpRequest
148148
:param response: The response received by the server. Is None if no response received.
149149
:type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
150150
"""
@@ -268,7 +268,7 @@ def set_http_attributes(
268268
Add correct attributes for a http client span.
269269
270270
:param request: The request made
271-
:type request: HttpRequest
271+
:type request: azure.core.rest.HttpRequest
272272
:param response: The response received from the server. Is None if no response received.
273273
:type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
274274
"""

sdk/core/azure-core/doc/azure.core.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ azure.core.credentials
3535
:inherited-members:
3636

3737
azure.core.credentials_async
38-
---------------------
38+
----------------------------
3939

4040
.. automodule:: azure.core.credentials_async
4141
:members:
@@ -50,7 +50,7 @@ azure.core.exceptions
5050
:undoc-members:
5151

5252
azure.core.messaging
53-
-------------------
53+
--------------------
5454

5555
.. automodule:: azure.core.messaging
5656
:members:
@@ -74,23 +74,23 @@ azure.core.settings
7474
:inherited-members:
7575

7676
azure.core.serialization
77-
-------------------
77+
------------------------
7878

7979
.. automodule:: azure.core.serialization
8080
:members:
8181
:undoc-members:
8282
:inherited-members:
8383

8484
azure.core.rest
85-
-------------------
85+
---------------
8686

8787
.. automodule:: azure.core.rest
8888
:members:
8989
:undoc-members:
9090
:inherited-members:
9191

9292
azure.core.utils
93-
-------------------
93+
----------------
9494

9595
.. automodule:: azure.core.utils
9696
:members:

sdk/core/azure-core/doc/azure.rst

-14
This file was deleted.

sdk/core/azure-core/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ mypy = true
33
type_check_samples = true
44
verifytypes = true
55
pyright = false
6+
strict_sphinx = true
67
# For test environments or static checks where a check should be run by default, not explicitly disabling will enable the check.
78
# pylint is enabled by default, so there is no reason for a pylint = true in every pyproject.toml.
89
#

0 commit comments

Comments
 (0)