You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/12/02 14:13:13 UTC

[avro] branch master updated: Code should go into code block (#1994)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 4359e1915 Code should go into code block (#1994)
4359e1915 is described below

commit 4359e1915d615ede3203f0b7479ea041b28b6cb2
Author: Daniel Javorszky <da...@gmail.com>
AuthorDate: Fri Dec 2 15:13:06 2022 +0100

    Code should go into code block (#1994)
---
 doc/content/en/docs/++version++/Getting started (Python)/_index.md | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/content/en/docs/++version++/Getting started (Python)/_index.md b/doc/content/en/docs/++version++/Getting started (Python)/_index.md
index d4a652f3e..da67be791 100644
--- a/doc/content/en/docs/++version++/Getting started (Python)/_index.md	
+++ b/doc/content/en/docs/++version++/Getting started (Python)/_index.md	
@@ -125,9 +125,12 @@ We create a DataFileWriter, which we'll use to write serialized items to a data
 * The file we'll serialize to
 * A DatumWriter, which is responsible for actually serializing the items to Avro's binary format (DatumWriters can be used separately from DataFileWriters, e.g., to perform IPC with Avro).
 * The schema we're using. The DataFileWriter needs the schema both to write the schema to the data file, and to verify that the items we write are valid items and write the appropriate fields.
+
+```python
 writer.append({"name": "Alyssa", "favorite_number": 256})
 writer.append({"name": "Ben", "favorite_number": 7, "favorite_color": "red"})
-        
+```
+     
 We use DataFileWriter.append to add items to our data file. Avro records are represented as Python dicts. Since the field favorite_color has type ["string", "null"], we are not required to specify this field, as shown in the first append. Were we to omit the required name field, an exception would be raised. Any extra entries not corresponding to a field are present in the dict are ignored.
 
 ```python