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

[Python] pyarrow.scalar doesn't accept nested pyarrow values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Python

    Description

      Easiest explained in code:

      import pyarrow as pa
      
      t1 = pa.struct([('x', pa.int64())])
      t2 = pa.struct([('y', t1)])
      
      t1_py = {'x', 0}
      t1_pa = pa.scalar(t1_py, type=t1)
      
      t2_py = {'y': {'x': 0}}
      t2_pa = pa.scalar(t2_py, type=t2)  # works
      
      t2_mixed = {'y': t1_pa}
      t2_pa_mix = pa.scalar(t2_mixed, type=t2)  # fails
      assert t2_pa_mix == t2_pa
      

      Is there some other way to construct the pyarrow struct value corresponding to t2_pa given t1_pa directly, without going through python first (i.e. constructing t1_py)?

      Attachments

        Activity

          People

            Unassigned Unassigned
            vladfi Vlad Firoiu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: