cudf icon indicating copy to clipboard operation
cudf copied to clipboard

[FEA] Ability to track `CopyOnWriteBuffer` by sharing references

Open galipremsagar opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. With CopyOnWriteBuffer we should explore if we can just pass on the CopyOnWriteBuffer reference to another column and still create a weak reference. for example:

y = CopyOnWriteBuffer(..)
x = y # Should establish a weak reference or something of that sort
x2 = y.copy(deep=True)  # currently only this achieves establishing a weak-reference.

galipremsagar avatar Feb 08 '23 18:02 galipremsagar

@galipremsagar @madsbk do you think that the unification of COW and spilling changed how this should work?

vyasr avatar May 17 '24 17:05 vyasr

I don't think it is possible to overload assignment of a variable in Python. That is, we cannot do anything here:

x = y # Should establish a weak reference or something of that sort

Or maybe I am misunderstanding the idea?

madsbk avatar May 22 '24 07:05 madsbk

You're right that we can't override the behavior of the assignment operator, I guess I was wondering exactly what @galipremsagar was hoping to accomplish here and if there's another way to do it and if anything has changed. If it really is just about the assignment operator then yeah we just have to close this.

vyasr avatar May 23 '24 03:05 vyasr

Yes, this is about trying to keep track of references somewhere whenever there is an assignment operator. Unfortunately, I didn't find a solution to this problem. So, I will close this issue for now.

galipremsagar avatar Jun 05 '24 02:06 galipremsagar