Skip to content

Cannot hash datetime64 #188

Closed
Closed

Description

@gerritholl
In [59]: joblib.hashing.hash(numpy.zeros(dtype="<m8[s]", shape=(10,)))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-59-8b9b8a0f034d> in <module>()
----> 1 joblib.hashing.hash(numpy.zeros(dtype="<m8[s]", shape=(10,)))

/export/data/home/gholl/venv/bleeding/lib/python3.4/site-packages/joblib/hashing.py in hash(obj, hash_name, coerce_mmap)
    199     else:
    200         hasher = Hasher(hash_name=hash_name)
--> 201     return hasher.hash(obj)

/export/data/home/gholl/venv/bleeding/lib/python3.4/site-packages/joblib/hashing.py in hash(self, obj, return_digest)
     51     def hash(self, obj, return_digest=True):
     52         try:
---> 53             self.dump(obj)
     54         except pickle.PicklingError as e:
     55             warnings.warn('PicklingError while hashing %r: %r' % (obj, e))

/usr/lib64/python3.4/pickle.py in dump(self, obj)
    408         if self.proto >= 4:
    409             self.framer.start_framing()
--> 410         self.save(obj)
    411         self.write(STOP)
    412         self.framer.end_framing()

/export/data/home/gholl/venv/bleeding/lib/python3.4/site-packages/joblib/hashing.py in save(self, obj)
    162                 # Python 3.2's memoryview raise a ValueError instead of a
    163                 # TypeError or a BufferError
--> 164                 self._hash.update(self._getbuffer(obj.flatten()))
    165 
    166             # We store the class, to be able to distinguish between

ValueError: cannot include dtype 'm' in a buffer

Activity

  1. gerritholl commented on Feb 24, 2015

    @gerritholl
    Author

    Should this be caught like PicklingErrors are caught?

  2. gerritholl commented on Feb 24, 2015

    @gerritholl
    Author
  3. mangecoeur commented on Mar 23, 2015

    @mangecoeur

    Also seeing this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions