-
Notifications
You must be signed in to change notification settings - Fork 902
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
Frame copy to use __class__ instead of type() #9397
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-21.12 #9397 +/- ##
================================================
- Coverage 10.79% 10.74% -0.05%
================================================
Files 116 116
Lines 18869 19081 +212
================================================
+ Hits 2036 2051 +15
- Misses 16833 17030 +197
Continue to review full report at Codecov.
|
rerun tests |
@gpucibot merge |
Adding testing of cudf dataframe copy, which fails prior to rapidsai/cudf#9397 #### UPDATE: This PR now handles the jit-unspill failures we have been seeing with cudf v21.12. Some background, when we introduced `ProxyObject`, cudf was using `cudf._lib.table.Table` as the base class for all frame-like objects (dataframes, series, etc). `Table` was implemented in cython so our proxy object had to derive from `Table` in order to support cython functions. The result was to use the class `FrameProxyObject` as a workaround: ```python # In order to support the cuDF API implemented in Cython, we inherit from # `cudf._lib.table.Table`, which is the base class of Index, Series, and # Dataframes in cuDF. # Notice, the order of base classes matters. Since ProxyObject is the first # base class, ProxyObject.__init__() is called on creation, which doesn't # define the Table._data and Table._index attributes. Thus, accessing # FrameProxyObject._data and FrameProxyObject._index is pass-through to # ProxyObejct.__getattr__(), which is what we want. class FrameProxyObject(ProxyObject, cudf._lib.table.Table): pass ``` Now that cudf uses `Frame`, a pure Python class, we don't need this workaround anymore. In fact, using `FrameProxyObject` triggers some infinite recursion errors when used together with v21.12+ cc. @randerzander Authors: - Mads R. B. Kristensen (https://github.com/madsbk) Approvers: - Peter Andreas Entschev (https://github.com/pentschev) URL: #751
This PR address the asymmetry in the following line in
Frame.copy()
:The problem is that
self.__class__
might not equaltype(self)
, which is the case for proxy objects like the one used in Dask-CUDA.Related Dask-CUDA PR: rapidsai/dask-cuda#751
cc. @randerzander