Skip to content

Commit 4a7f13e

Browse files
jbrockmendelproost
authored andcommitted
CLN: dont alter state when returning data/values (pandas-dev#30240)
1 parent e099eca commit 4a7f13e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/io/pytables.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1994,9 +1994,8 @@ def convert(self, values: np.ndarray, nan_rep, encoding: str, errors: str):
19941994
self.values = new_pd_index
19951995

19961996
def take_data(self):
1997-
""" return the values & release the memory """
1998-
self.values, values = None, self.values
1999-
return values
1997+
""" return the values"""
1998+
return self.values
20001999

20012000
@property
20022001
def attrs(self):
@@ -2249,9 +2248,8 @@ def set_data(self, data: Union[np.ndarray, ABCExtensionArray]):
22492248
self.kind = _dtype_to_kind(dtype_name)
22502249

22512250
def take_data(self):
2252-
""" return the data & release the memory """
2253-
self.data, data = None, self.data
2254-
return data
2251+
""" return the data """
2252+
return self.data
22552253

22562254
@classmethod
22572255
def _get_atom(cls, values: Union[np.ndarray, ABCExtensionArray]) -> "Col":

0 commit comments

Comments
 (0)