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

[Python] Implement better DataType hash function

    Details

      Description

      >>> x = pa.field('record', pa.struct([pa.field('x', pa.int32(), nullable=False)]))
      >>> y = pa.field('record', pa.struct([pa.field('x', pa.int32(), nullable=True)]))
      >>> z = pa.field('record', pa.struct([pa.field('x', pa.int32(), nullable=True)]))
      >>> x.__hash__()
      -9223372036569171727
      >>> y.__hash__()
      285604054
      >>> z.__hash__()
      285604076
      >>> x.type
      StructType(struct<x: int32>)
      >>> x.type.__hash__()
      429437081997812647
      >>> y.type.__hash__()
      429437081997812647
      >>> x
      pyarrow.Field<record: struct<x: int32>>
      >>> y
      pyarrow.Field<record: struct<x: int32>>
      
      

      Expected:

      y._hash() should be the same as z.hash_()

      x.type._hash() should be different than y.type.hash_()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kszucs Krisztian Szucs
                Reporter:
                samo Sam Oluwalana
              • Votes:
                0 Vote for this issue
                Watchers:
                4 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 - 5.5h
                  5.5h