Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-155

Make avro.io.DataFileReader iterable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • python
    • None
    • Reviewed

    Description

      When reading records out of a file object container using the Python bindings, it would be great to be able to say:

      for record in dfr:
        <do something with record>
      

      There's already a "next()" method defined on the DataFileReader, but the _iter_ method is not defined and we "return None" instead of "raise StopIteration" when out of records.

      Attachments

        1. AVRO-155_with_test.patch
          1 kB
          Sharad Agarwal
        2. AVRO-155.patch
          0.7 kB
          Jeff Hammerbacher

        Activity

          People

            hammer Jeff Hammerbacher
            hammer Jeff Hammerbacher
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: