Skip to content

Commit 22c4bf0

Browse files
committed
Update docs metadata
1 parent 83de0b4 commit 22c4bf0

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

docs-ref-services/preview/schemaregistry-avroencoder-readme.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ title: Azure Schema Registry Avro Encoder client library for Python
33
keywords: Azure, python, SDK, API, azure-schemaregistry-avroencoder, schemaregistry
44
author: yunhaoling
55
ms.author: yuling
6-
ms.date: 02/10/2022
6+
ms.date: 03/09/2022
77
ms.topic: reference
88
ms.prod: azure
99
ms.technology: azure
1010
ms.devlang: python
1111
ms.service: schemaregistry
1212
---
13-
# Azure Schema Registry Avro Encoder client library for Python - Version 1.0.0b1
13+
# Azure Schema Registry Avro Encoder client library for Python - Version 1.0.0b2
1414

1515

1616
Azure Schema Registry is a schema repository service hosted by Azure Event Hubs, providing schema storage, versioning,
1717
and management. This package provides an Avro encoder capable of encoding and decoding payloads containing
18-
Schema Registry schema identifiers and Avro-encoded data.
18+
Schema Registry schema identifiers and Avro-encoded content.
1919

2020
[Source code][source_code] | [Package (PyPi)][pypi] | [API reference documentation][api_reference] | [Samples][sr_avro_samples] | [Changelog][change_log]
2121

@@ -83,13 +83,13 @@ content type with schema ID. Uses [SchemaRegistryClient][schemaregistry_client]
8383

8484
Support has been added to certain Azure Messaging SDK model classes for interoperability with the `AvroEncoder`. These models are subtypes of the `MessageType` protocol defined under the `azure.schemaregistry.encoder.avroencoder` namespace. Currently, the supported model classes are:
8585

86-
- `azure.eventhub.EventData` for `azure-eventhub==5.9.0b1`
86+
- `azure.eventhub.EventData` for `azure-eventhub==5.9.0b2`
8787

8888
### Message format
8989

90-
If a message type that follows the MessageType protocol is provided to the encoder, it will encode the corresponding data and content type properties as follows:
90+
If a message type that follows the MessageType protocol is provided to the encoder, it will encode the corresponding content and content type properties as follows:
9191

92-
- `data`: Avro payload (in general, format-specific payload)
92+
- `content`: Avro payload (in general, format-specific payload)
9393
- Avro Binary Encoding
9494
- NOT Avro Object Container File, which includes the schema and defeats the
9595
purpose of this encoder to move the schema out of the message payload and
@@ -100,7 +100,7 @@ If a message type that follows the MessageType protocol is provided to the encod
100100
- `<schema ID>` is the hexadecimal representation of GUID, same format and byte order as the string from the Schema Registry service.
101101

102102
If message type or callback function is not provided, and by default, the encoder will create the following dict:
103-
`{"data": <Avro encoded payload>, "content_type": 'avro/binary+<schema ID>' }`
103+
`{"content": <Avro encoded payload>, "content_type": 'avro/binary+<schema ID>' }`
104104

105105
## Examples
106106

@@ -113,7 +113,7 @@ The following sections provide several code snippets covering some of the most c
113113

114114
### Encoding
115115

116-
Use `AvroEncoder.encode` method to encode dict data with the given Avro schema.
116+
Use `AvroEncoder.encode` method to encode dict content with the given Avro schema.
117117
The method will use a schema previously registered to the Schema Registry service and keep the schema cached for future encoding usage. It is also possible to avoid pre-registering the schema to the service and automatically register with the `encode` method by instantiating the `AvroEncoder` with the keyword argument `auto_register_schemas=True`.
118118

119119
```python
@@ -145,20 +145,20 @@ schema_register_client.register(group_name, name, definition, format)
145145
encoder = AvroEncoder(client=schema_registry_client, group_name=group_name)
146146

147147
with encoder:
148-
dict_data = {"name": "Ben", "favorite_number": 7, "favorite_color": "red"}
149-
event_data = encoder.encode(dict_data, schema=definition, message_type=EventData)
148+
dict_content = {"name": "Ben", "favorite_number": 7, "favorite_color": "red"}
149+
event_data = encoder.encode(dict_content, schema=definition, message_type=EventData)
150150

151151
# OR
152152

153-
metadata_dict = encoder.encode(dict_data, schema=definition)
154-
event_data = EventData.from_message_data(metadata_dict["data"], metadata_dict["content_type"])
153+
message_content_dict = encoder.encode(dict_content, schema=definition)
154+
event_data = EventData.from_message_content(message_content_dict["content"], message_content_dict["content_type"])
155155
```
156156

157157
### Decoding
158158

159-
Use `AvroEncoder.decode` method to decode the bytes value into dict data by either:
159+
Use `AvroEncoder.decode` method to decode the bytes value into dict content by either:
160160
- Passing in a message object that is a subtype of the MessageType protocol.
161-
- Passing in a dict with keys `data`(type bytes) and `content_type` (type string).
161+
- Passing in a dict with keys `content`(type bytes) and `content_type` (type string).
162162
The method automatically retrieves the schema from the Schema Registry Service and keeps the schema cached for future decoding usage.
163163

164164
```python
@@ -176,19 +176,19 @@ encoder = AvroEncoder(client=schema_registry_client, group_name=group_name)
176176

177177
with encoder:
178178
# event_data is an EventData object with Avro encoded body
179-
decoded_data = encoder.decode(event_data)
179+
decoded_content = encoder.decode(event_data)
180180

181181
# OR
182182

183-
encoded_bytes = b'<data_encoded_by_azure_schema_registry_avro_encoder>'
183+
encoded_bytes = b'<content_encoded_by_azure_schema_registry_avro_encoder>'
184184
content_type = 'avro/binary+<schema_id_of_corresponding_schema>'
185-
data_dict = {"data": encoded_bytes, "content_type": content_type}
186-
decoded_data = encoder.decode(data_dict)
185+
content_dict = {"content": encoded_bytes, "content_type": content_type}
186+
decoded_content = encoder.decode(content_dict)
187187
```
188188

189189
### Event Hubs Sending Integration
190190

191-
Integration with [Event Hubs][eventhubs_repo] to send encoded Avro dict data as the body of EventData.
191+
Integration with [Event Hubs][eventhubs_repo] to send encoded Avro dict content as the body of EventData.
192192

193193
```python
194194
import os
@@ -224,15 +224,15 @@ eventhub_producer = EventHubProducerClient.from_connection_string(
224224

225225
with eventhub_producer, avro_encoder:
226226
event_data_batch = eventhub_producer.create_batch()
227-
dict_data = {"name": "Bob", "favorite_number": 7, "favorite_color": "red"}
228-
event_data = avro_encoder.encode(dict_data, schema=definition, message_type=EventData)
227+
dict_content = {"name": "Bob", "favorite_number": 7, "favorite_color": "red"}
228+
event_data = avro_encoder.encode(dict_content, schema=definition, message_type=EventData)
229229
event_data_batch.add(event_data)
230230
eventhub_producer.send_batch(event_data_batch)
231231
```
232232

233233
### Event Hubs Receiving Integration
234234

235-
Integration with [Event Hubs][eventhubs_repo] to receive `EventData` and decoded raw bytes into Avro dict data.
235+
Integration with [Event Hubs][eventhubs_repo] to receive `EventData` and decoded raw bytes into Avro dict content.
236236

237237
```python
238238
import os
@@ -257,7 +257,7 @@ eventhub_consumer = EventHubConsumerClient.from_connection_string(
257257
)
258258

259259
def on_event(partition_context, event):
260-
decoded_data = avro_encoder.decode(event)
260+
decoded_content = avro_encoder.decode(event)
261261

262262
with eventhub_consumer, avro_encoder:
263263
eventhub_consumer.receive(on_event=on_event, starting_position="-1")
@@ -301,7 +301,7 @@ encoder = AvroEncoder(client=schema_registry_client, group_name="<your-group-nam
301301
Similarly, `logging_enable` can enable detailed logging for a single operation,
302302
even when it isn't enabled for the client:
303303
```py
304-
encoder.encode(dict_data, schema=schema_definition, logging_enable=True)
304+
encoder.encode(dict_content, schema=schema_definition, logging_enable=True)
305305
```
306306

307307
## Next steps
@@ -326,17 +326,17 @@ contact [[email protected]](mailto:[email protected]) with any additio
326326

327327
<!-- LINKS -->
328328
[pip]: https://pypi.org/project/pip/
329-
[pypi]: https://pypi.org/
329+
[pypi]: https://pypi.org/project/azure-schemaregistry-avroencoder/
330330
[python]: https://www.python.org/downloads/
331-
[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/azure-schemaregistry-avroencoder_1.0.0b1/sdk/core/azure-core/README.md
331+
[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/azure-schemaregistry-avroencoder_1.0.0b2/sdk/core/azure-core/README.md
332332
[azure_sub]: https://azure.microsoft.com/free/
333333
[python_logging]: https://docs.python.org/3/library/logging.html
334-
[sr_avro_samples]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b1/sdk/schemaregistry/azure-schemaregistry-avroencoder/samples
335-
[api_reference]: https://docs.microsoft.com/python/api/
336-
[source_code]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b1/sdk/schemaregistry/azure-schemaregistry-avroencoder
337-
[change_log]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b1/sdk/schemaregistry/azure-schemaregistry-avroencoder/CHANGELOG.md
338-
[schemaregistry_client]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b1/sdk/schemaregistry/azure-schemaregistry
334+
[sr_avro_samples]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b2/sdk/schemaregistry/azure-schemaregistry-avroencoder/samples
335+
[api_reference]: https://docs.microsoft.com/python/api/overview/azure/schemaregistry-avroencoder-readme
336+
[source_code]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b2/sdk/schemaregistry/azure-schemaregistry-avroencoder
337+
[change_log]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b2/sdk/schemaregistry/azure-schemaregistry-avroencoder/CHANGELOG.md
338+
[schemaregistry_client]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b2/sdk/schemaregistry/azure-schemaregistry
339339
[schemaregistry_service]: https://aka.ms/schemaregistry
340-
[eventhubs_repo]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b1/sdk/eventhub/azure-eventhub
341-
[token_credential_interface]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b1/sdk/core/azure-core/azure/core/credentials.py
340+
[eventhubs_repo]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b2/sdk/eventhub/azure-eventhub
341+
[token_credential_interface]: https://github.com/Azure/azure-sdk-for-python/tree/azure-schemaregistry-avroencoder_1.0.0b2/sdk/core/azure-core/azure/core/credentials.py
342342
[pypi_azure_identity]: https://pypi.org/project/azure-identity/
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name": "azure-schemaregistry-avroencoder",
3-
"Version": "1.0.0b1",
3+
"Version": "1.0.0b2",
44
"DevVersion": null,
55
"DirectoryPath": "sdk/schemaregistry/azure-schemaregistry-avroencoder",
66
"ServiceDirectory": "schemaregistry",
@@ -10,5 +10,5 @@
1010
"SdkType": "client",
1111
"IsNewSdk": false,
1212
"ArtifactName": "azure-schemaregistry-avroencoder",
13-
"ReleaseStatus": "2022-02-09"
13+
"ReleaseStatus": "2022-03-09"
1414
}

0 commit comments

Comments
 (0)