Hello, do you know if the artifact sha changes for...
# ask-metaflow
r
Hello, do you know if the artifact sha changes for some objects when it’s retrieved from the datastore? I think I’m experiencing a situation where retrieving the object through
some_obj = getattr(self, name)
is changing the sha of
some_obj
when the task finishes and resaves that object.
1
d
that is possible. Pickle isn’t always stable. Metaflow can’t tell the difference between “object was just read” and “object was read and modified” because there isn’t, for example, a notion of a const like there is in C/C++. In most cases though, you will maybe pay a bit of extra storage/time but there should be no functional problems. The only time we see functional issues are with merge_artifacts (things fail to merge). In that case, you can explicitly assign your variable (something like this:
Copy code
self.my_var = inputs[0].my_var
self.merge_artifacts...
r
yea i’m seeing this when I’m trying to
merge_artifacts
I think one potential repercussion of this is the datastore potentially storing multiple copies of the data in the flow. I’m digging deeper into this but it seems to affect custom objects
d
yep. That is a repercussion. If it is a custom object, you can probably edit your setstate/getstate functions to return more consistent data (maybe an ordering thing, etc — no idea since I don’t know the object 🙂 )
some standard python objects can exhibit this I think too (I think I’ve seen sets for example)
but if it is one of your objects, you may be in luck and able to modify those pickling functions 🙂
r
yea that’s what i was thinking too, there must be some non deterministic thing going on
yup. thanks for the insights
d
sure. anytime.