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

[Python] Better repr for Buffer, MemoryPool and friends

    XMLWordPrintableJSON

Details

    Description

      I think we can improve interactive use of PyArrow by making the repr of some basic types (Buffer, MemoryPool...) more informative.
      See this session for example:

      >>> pool = pa.default_memory_pool()
      >>> pool
      <pyarrow.lib.MemoryPool at 0x7fea126982a0>
      >>> pool.backend_name
      'jemalloc'
      >>> buf = pa.allocate_buffer(1024, memory_pool=pool)
      >>> buf
      <pyarrow.lib.Buffer at 0x7fea5e51e7b0>
      >>> buf.is_cpu
      True
      >>> buf.is_mutable
      True
      >>> buf.size
      1024
      

      Attachments

        Issue Links

          Activity

            People

              milesgranger Miles Granger
              apitrou Antoine Pitrou
              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 - 4h
                  4h