Skip to content

Commit 6a407d4

Browse files
authored
[SchemaRegistry] fix sphinx (#35018)
* fix sphinx * add sphinx check to avroencoder * remove unnecessary docfiles for azure.schemaregistry to fix sphinx error
1 parent 4b2eebb commit 6a407d4

File tree

11 files changed

+23
-54
lines changed

11 files changed

+23
-54
lines changed

sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_schema_registry_avro_encoder.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
)
5353

5454
if TYPE_CHECKING:
55-
from azure.schemaregistry import SchemaRegistryClient
55+
import azure.schemaregistry
5656

5757
_LOGGER = logging.getLogger(__name__)
5858

@@ -75,7 +75,7 @@ class AvroEncoder(object):
7575
def __init__(
7676
self,
7777
*,
78-
client: "SchemaRegistryClient",
78+
client: "azure.schemaregistry.SchemaRegistryClient",
7979
group_name: Optional[str] = None,
8080
auto_register: bool = False,
8181
**kwargs: Any
@@ -239,8 +239,9 @@ def decode(
239239
**kwargs: Any,
240240
) -> Dict[str, Any]:
241241
"""Decode bytes content using schema ID in the content type field. `message` must be one of the following:
242-
1) An object of subtype of the MessageType protocol.
243-
2) A dict {"content": ..., "content_type": ...}, where "content" is bytes and "content_type" is string.
242+
1) An object of subtype of the MessageType protocol.
243+
2) A dict {"content": ..., "content_type": ...}, where "content" is bytes and "content_type" is string.
244+
244245
Content must follow format of associated Avro RecordSchema:
245246
https://avro.apache.org/docs/1.10.0/gettingstartedpython.html#Defining+a+schema
246247
@@ -257,6 +258,7 @@ def decode(
257258
Indicates an issue with validating schemas.
258259
:raises ~azure.schemaregistry.encoder.avroencoder.InvalidContentError:
259260
Indicates an issue with decoding content.
261+
260262
"""
261263
schema_id, content = validate_message(message)
262264
cache_misses = (

sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/_schema_registry_avro_encoder_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ async def decode(
227227
"""Decode bytes content using schema ID in the content type field. `message` must be one of the following:
228228
1) A object of subtype of the MessageType protocol.
229229
2) A dict {"content": ..., "content_type": ...}, where "content" is bytes and "content_type" is string.
230+
230231
Content must follow format of associated Avro RecordSchema:
231232
https://avro.apache.org/docs/1.10.0/gettingstartedpython.html#Defining+a+schema
232233

sdk/schemaregistry/azure-schemaregistry-avroencoder/doc/azure.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

sdk/schemaregistry/azure-schemaregistry-avroencoder/doc/azure.schemaregistry.encoder.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

sdk/schemaregistry/azure-schemaregistry-avroencoder/doc/azure.schemaregistry.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

sdk/schemaregistry/azure-schemaregistry-avroencoder/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ mypy = true
33
pyright = false
44
type_check_samples = true
55
verifytypes = true
6+
strict_sphinx = true

sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_encoder_protocols.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ def encode(
237237
:returns: TypedDict of encoded content and content type if `message_type` is not set, otherwise the
238238
constructed message object.
239239
:rtype: MessageType or MessageContent
240+
240241
"""
242+
...
241243

242244
def decode(
243245
self, # pylint: disable=unused-argument
@@ -250,11 +252,14 @@ def decode(
250252
Returns the decoded data with the schema format specified by the `content-type` property.
251253
If `validate` callable was passed to constructor, will validate content against schema retrieved
252254
from the registry after decoding.
255+
253256
:param message: The message object which holds the content to be decoded and content type
254257
containing the schema ID.
255258
:type message: MessageType or MessageContent
256259
:keyword request_options: The keyword arguments for http requests to be passed to the client.
257260
:paramtype request_options: dict[str, any] or None
258261
:returns: The decoded content.
259262
:rtype: dict[str, any]
263+
260264
"""
265+
...

sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_encoder_protocol_async.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ async def encode(
178178
constructed message object.
179179
:rtype: MessageType or MessageContent
180180
"""
181+
...
181182

182183
async def decode(
183184
self, # pylint: disable=unused-argument
@@ -190,11 +191,14 @@ async def decode(
190191
Returns the decoded data with the schema format specified by the `content-type` property.
191192
If `validate` callable was passed to constructor, will validate content against schema retrieved
192193
from the registry after decoding.
194+
193195
:param message: The message object which holds the content to be decoded and content type
194196
containing the schema ID.
195197
:type message: MessageType or MessageContent
196198
:keyword request_options: The keyword arguments for http requests to be passed to the client.
197199
:paramtype request_options: dict[str, any] or None
198200
:returns: The decoded content.
199201
:rtype: dict[str, any]
202+
200203
"""
204+
...

sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/encoder/jsonencoder/_schema_registry_json_encoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
)
5252

5353
if TYPE_CHECKING:
54-
from ..._schema_registry_client import SchemaRegistryClient
54+
import azure.schemaregistry
5555
from ..._encoder_protocols import MessageContent, SchemaContentValidate
5656

5757
_LOGGER = logging.getLogger(__name__)
@@ -78,7 +78,7 @@ class JsonSchemaEncoder(object):
7878
def __init__(
7979
self,
8080
*,
81-
client: "SchemaRegistryClient",
81+
client: "azure.schemaregistry.SchemaRegistryClient",
8282
validate: Union[JsonSchemaDraftIdentifier, str, "SchemaContentValidate"],
8383
group_name: Optional[str] = None,
8484
) -> None:

sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/encoder/jsonencoder/aio/_schema_registry_json_encoder_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from ._async_lru import alru_cache # pylint: disable=import-error
4444

4545
if TYPE_CHECKING:
46-
from ....aio._schema_registry_client_async import SchemaRegistryClient
46+
import azure.schemaregistry.aio
4747
from ...._encoder_protocols import MessageContent, SchemaContentValidate
4848

4949
_LOGGER = logging.getLogger(__name__)
@@ -56,7 +56,7 @@ class JsonSchemaEncoder(object):
5656
5757
:keyword client: Required. The schema registry client which is used to retrieve schema from the service.
5858
and retrieve schema from the service.
59-
:paramtype client: ~azure.schemaregistry.SchemaRegistryClient
59+
:paramtype client: ~azure.schemaregistry.aio.SchemaRegistryClient
6060
:keyword validate: Required. Used for validation in encode and decode.
6161
If a JsonSchemaDraftIdentifier value or equivalent string is provided, the corresponding validator from
6262
`jsonschema` will be used. In this case, `jsonschema` MUST be installed separately or by installing the
@@ -71,7 +71,7 @@ class JsonSchemaEncoder(object):
7171
def __init__(
7272
self,
7373
*,
74-
client: "SchemaRegistryClient",
74+
client: "azure.schemaregistry.aio.SchemaRegistryClient",
7575
validate: Union[JsonSchemaDraftIdentifier, str, "SchemaContentValidate"],
7676
group_name: Optional[str] = None,
7777
) -> None:

0 commit comments

Comments
 (0)