-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TMP, do not merge] adding example for task with FuctionImage #432
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #432 +/- ##
===========================================
- Coverage 82.47% 42.62% -39.86%
===========================================
Files 20 20
Lines 3858 3871 +13
Branches 1049 1052 +3
===========================================
- Hits 3182 1650 -1532
- Misses 484 1897 +1413
- Partials 192 324 +132
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
this may help track down the issue. while the functionality of an object is preserved through a roundtrip through cloudpickle, the bytestring is not preserved. so if the test that is failing is saving the task to file and loading it, it would likely get a different hash. In [15]: def func1(a):
...: return a + 1
...: class foo:
...: def test(self, b):
...: return func1(b)
...:
In [16]: ff = foo()
In [17]: sha256(cp.dumps(ff)).hexdigest()
Out[17]: '9dcd775519701de26beab29199ef7259657c406caf5af36186192a0fa47967d4'
In [18]: sha256(cp.dumps(deepcopy(ff))).hexdigest()
Out[18]: '9dcd775519701de26beab29199ef7259657c406caf5af36186192a0fa47967d4'
In [19]: sha256(cp.dumps(cp.loads(cp.dumps(ff)))).hexdigest()
Out[19]: 'b85dbb27044c14651596da8eaba9818cfa6351162cc296b2bc1df571891b35c2'
In [20]: ff.test(1)
Out[20]: 2
In [21]: cp.loads(cp.dumps(ff)).test(1)
Out[21]: 2 |
indeed, we should not rely on pickle. you could consider using the in the short term we could issue exceptions and/or force those tasks to always run. |
here is a related post (but old - some things in python have changed with 3.x): https://stackoverflow.com/questions/16157835/create-hash-for-arbitrary-objects/ |
@satra - I actually did test what happens when I create a |
Acknowledgment
Types of changes
Summary
showing example with
FunctionalImage
as an input - print statements show when the hash value changestest_5
is the one that failingChecklist
(we are using
black
: you canpip install pre-commit
,run
pre-commit install
in thepydra
directoryand
black
will be run automatically with each commit)