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

Add support for duration logical type to Python implementation

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • python
    • None

    Description

      The duration logical type was added back in \AVRO-739, but it still isn't in the Python implementation.

      Because durations encode an integer number of months in addition to days and seconds, the standard library's datetime.timedelta is insufficient for representing an Avro duration.

      One option is to return a tuple - the triplet of months, days, and seconds. Another option is to use a relativedelta from the well-known, but third-party, dateutil library. I would lean towards the latter, but I understand the downsides of adding a dependency.

      Attachments

        Activity

          People

            Unassigned Unassigned
            spencerwnelson Spencer Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: