Skip to content

Fix Sphinx error in core #32417

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 6 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
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
38 changes: 21 additions & 17 deletions sdk/core/azure-core/azure/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,29 @@ class ODataV4Format:

Example of JSON:

error: {
"code": "ValidationError",
"message": "One or more fields contain incorrect values: ",
"details": [
{
"code": "ValidationError",
"target": "representation",
"message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\\\\d+)?$'.
Path 'host', line 1, position 297."
},
{
.. code-block:: json

{
"error": {
"code": "ValidationError",
"target": "representation",
"message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate
https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
(schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)."
"message": "One or more fields contain incorrect values: ",
"details": [
{
"code": "ValidationError",
"target": "representation",
"message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\\\\d+)?$'.
Path 'host', line 1, position 297."
},
{
"code": "ValidationError",
"target": "representation",
"message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate
https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
(schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)."
}
]
}
]
}
}

:param dict json_object: A Python dict representing a ODataV4 JSON
:ivar str ~.code: Its value is a service-defined error code.
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure-core/azure/core/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def from_dict(cls, event: Dict[str, Any]) -> CloudEvent[DataType]:

@classmethod
def from_json(cls, event: Any) -> CloudEvent[DataType]:
"""
Returns the deserialized CloudEvent object when a json payload is provided.
"""Returns the deserialized CloudEvent object when a json payload is provided.

:param event: The json string that should be converted into a CloudEvent. This can also be
a storage QueueMessage, eventhub's EventData or ServiceBusMessage
:type event: object
Expand Down
8 changes: 0 additions & 8 deletions sdk/core/azure-core/azure/core/pipeline/policies/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ def on_exception(

:param request: The Pipeline request object
:type request: ~azure.core.pipeline.PipelineRequest

.. admonition:: Example:

.. literalinclude:: ../samples/test_example_sansio.py
:start-after: [START on_exception]
:end-before: [END on_exception]
:language: python
:dedent: 4
"""
return

Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure-core/azure/core/tracing/_abstract_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def set_http_attributes(self, request: HttpRequestType, response: Optional[HttpR
Add correct attributes for a http client span.

:param request: The request made
:type request: HttpRequest
:type request: azure.core.rest.HttpRequest
:param response: The response received by the server. Is None if no response received.
:type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
"""
Expand Down Expand Up @@ -268,7 +268,7 @@ def set_http_attributes(
Add correct attributes for a http client span.

:param request: The request made
:type request: HttpRequest
:type request: azure.core.rest.HttpRequest
:param response: The response received from the server. Is None if no response received.
:type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
"""
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/azure-core/doc/azure.core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ azure.core.credentials
:inherited-members:

azure.core.credentials_async
---------------------
----------------------------

.. automodule:: azure.core.credentials_async
:members:
Expand All @@ -50,7 +50,7 @@ azure.core.exceptions
:undoc-members:

azure.core.messaging
-------------------
--------------------

.. automodule:: azure.core.messaging
:members:
Expand All @@ -74,23 +74,23 @@ azure.core.settings
:inherited-members:

azure.core.serialization
-------------------
------------------------

.. automodule:: azure.core.serialization
:members:
:undoc-members:
:inherited-members:

azure.core.rest
-------------------
---------------

.. automodule:: azure.core.rest
:members:
:undoc-members:
:inherited-members:

azure.core.utils
-------------------
----------------

.. automodule:: azure.core.utils
:members:
Expand Down
14 changes: 0 additions & 14 deletions sdk/core/azure-core/doc/azure.rst

This file was deleted.

1 change: 1 addition & 0 deletions sdk/core/azure-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mypy = true
type_check_samples = true
verifytypes = true
pyright = false
strict_sphinx = true
# For test environments or static checks where a check should be run by default, not explicitly disabling will enable the check.
# pylint is enabled by default, so there is no reason for a pylint = true in every pyproject.toml.
#
Expand Down