Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-17832

[Python] Construct MapArray from sequence of dicts (instead of list of tuples)

    XMLWordPrintableJSON

Details

    Description

      From https://github.com/apache/arrow/issues/14116

      Creating a MapArray from a python sequence currently requires lists of tuples as values:

      arr = pa.array([[('a', 1), ('b', 2)], [('c', 3)]], pa.map_(pa.string(), pa.int64()))
      

      While I think it makes sense that the following could also work (using dicts instead):

      arr = pa.array([{'a': 1, 'b': 2}, {'c': 3}], pa.map_(pa.string(), pa.int64()))
      

      Attachments

        Issue Links

          Activity

            People

              kshitij12345 Kshiteej K
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m