Skip to content

REF: dont set self.data in pytables take_data #30240

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

Merged
merged 4 commits into from
Dec 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1994,9 +1994,8 @@ def convert(self, values: np.ndarray, nan_rep, encoding: str, errors: str):
self.values = new_pd_index

def take_data(self):
""" return the values & release the memory """
self.values, values = None, self.values
return values
""" return the values"""
return self.values

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

def take_data(self):
""" return the data & release the memory """
self.data, data = None, self.data
return data
""" return the data """
return self.data

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