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

[Python] DataType should be hashable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.8.0
    • Python

    Description

      We can then use the DataType objects as keys in dictionary for example. xref https://github.com/ibis-project/ibis/pull/1194#discussion_r148493472

      In [1]: import pyarrow as pa
      
      In [2]: pa.__version__
      Out[2]: '0.7.1'
      
      In [3]: pa.int8()
      Out[3]: DataType(int8)
      
      In [4]: hash(pa.int8())
      ---------------------------------------------------------------------------
      TypeError                                 Traceback (most recent call last)
      <ipython-input-4-bca0e6e2f6af> in <module>()
      ----> 1 hash(pa.int8())
      
      TypeError: unhashable type: 'pyarrow.lib.DataType'
      

      Attachments

        Issue Links

          Activity

            People

              wesm Wes McKinney
              jreback Jeff Reback
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: