Skip to content

Regression for unpickling due to #11166 #11408

Closed

Description

@jnothman

As reported in #11166 (comment):

This has broken CircleCI on master, which is trying, if I understand correctly, to load pickles which reference sklearn.externals.joblib.numpy_pickle, resulting in an ImportError.

Firstly, I presume to fix Circle, we just need to clear a cache somewhere (but I've not worked out where).

Secondly, are we unnecessarily breaking pickles from previous versions? Should we see if we can find a way to make this function importable when loading a joblib pickle?

See subsequent discussion there.

This issue is just to make sure we have some resolution before 0.20 release

Activity

  1. added this to the 0.20 milestone on Jul 3, 2018
  2. jnothman commented on Jul 5, 2018

    @jnothman
    MemberAuthor

    I'm getting annoyed by all the circle failures. Should we just switch the .joblib and ._joblib?

  3. jnothman commented on Jul 10, 2018

    @jnothman
    MemberAuthor

    I've tried using six.moves magic, and tried using slightly less magic, but I'm not making much progress. I agree it's quite annoying that we might need to leave sklearn.externals.joblib there and have uses of sklearn.externals._joblib in examples, etc.

    One option might be to stop using sklearn.externals.joblib internally, by moving all components we use to sklearn.utils`.

    from sklearn.externals.joblib import load
    
    
    def test_old_pickle(tmpdir):
        # Check that a pickle that references sklearn.external.joblib can load
        f = tmpdir.join('foo.pkl')
        f.write(b'\x80\x03csklearn.externals.joblib.numpy_pickle\nNumpyArrayWrappe'
                b'r\nq\x00)\x81q\x01}q\x02(X\n\x00\x00\x00allow_mmapq\x03\x88X\x05'
                b'\x00\x00\x00shapeq\x04K\x01\x85q\x05X\x05\x00\x00\x00dtypeq\x06c'
                b'numpy\ndtype\nq\x07X\x02\x00\x00\x00i8q\x08K\x00K\x01\x87q\tRq\n'
                b'(K\x03X\x01\x00\x00\x00<q\x0bNNNJ\xff\xff\xff\xffJ\xff\xff\xff'
                b'\xffK\x00tq\x0cbX\x08\x00\x00\x00subclassq\rcnumpy\nndarray\nq'
                b'\x0eX\x05\x00\x00\x00orderq\x0fX\x01\x00\x00\x00Cq\x10ub\x01\x00'
                b'\x00\x00\x00\x00\x00\x00.', mode='wb')
    
        load(str(f))
  4. added a commit that references this issue on Jul 17, 2018
    14e7c32
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions