You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Since loc and iloc use cached_property, the indexer classes will hang on to a reference to self even when the original object was dereferenced
Steps/Code to reproduce bug
In [1]: importweakref, cudf, pandasaspdIn [2]: df=cudf.DataFrame(range(1))
In [3]: ref=weakref.ref(df)
In [4]: df.iloc[0]
Out[4]:
00Name: 0, dtype: int64In [5]: deldfIn [6]: ref() isNoneOut[6]: FalseIn [7]: df1=pd.DataFrame(range(1))
In [8]: ref1=weakref.ref(df1)
In [9]: df1.iloc[0]
Out[9]:
00Name: 0, dtype: int64In [10]: deldf1In [11]: ref1() isNoneOut[11]: True
Expected behavior Out[6] should be True
Performance impact of just using @property (which I think is OK to eliminate this reference cycle)
In [2]: df=cudf.DataFrame(range(1))
In [3]: %timeitdf.loc# property272ns ± 24.3nsperloop (mean ± std. dev. of7runs, 1,000,000loopseach)
In [3]: %timeitdf.loc# cached_property46.3ns ± 1.63nsperloop (mean ± std. dev. of7runs, 10,000,000loopseach)
Environment overview (please complete the following information)
Environment location: Bare-metal
Method of cuDF install: conda
If method of install is [Docker], provide docker pull & docker run commands used
Environment details
Please run and paste the output of the cudf/print_env.sh script here, to gather any other relevant environment details
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
Since
loc
andiloc
usecached_property
, the indexer classes will hang on to a reference toself
even when the original object was dereferencedSteps/Code to reproduce bug
Expected behavior
Out[6]
should beTrue
Performance impact of just using
@property
(which I think is OK to eliminate this reference cycle)Environment overview (please complete the following information)
docker pull
&docker run
commands usedEnvironment details
Please run and paste the output of the
cudf/print_env.sh
script here, to gather any other relevant environment detailsAdditional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: