You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
On page 41 in the O'Reilly book, the file (test_avro.py) given as Example 3-2 has the same name as the file to write avros in Python given as Example 3-1.
What is more, the OUTFILE_NAME intialisation is missing. Here is the script (I named it test_reading_avro.py) with the suggested correction:
fromavroimportschema, datafile, ioimportpprint# Test reading avrosrec_reader=io.DatumReader()
# Create a 'data file' (avro file) readerOUTFILE_NAME='/tmp/messages.avro'df_reader=datafile.DataFileReader( open(OUTFILE_NAME), rec_reader)
# Read all records stored insidepp=pprint.PrettyPrinter()
forrecordindf_reader:
pp.pprint(record)
What is more, I run those scripts on Mac OS X, but they won't work on Microsoft Windows which has no /tmp directory.
Jean-Baptiste
The text was updated successfully, but these errors were encountered:
Hello,
On page 41 in the O'Reilly book, the file (test_avro.py) given as Example 3-2 has the same name as the file to write avros in Python given as Example 3-1.
What is more, the OUTFILE_NAME intialisation is missing. Here is the script (I named it test_reading_avro.py) with the suggested correction:
What is more, I run those scripts on Mac OS X, but they won't work on Microsoft Windows which has no /tmp directory.
Jean-Baptiste
The text was updated successfully, but these errors were encountered: