Skip to content

Commit

Permalink
refactor: ensure proper memory management with DataFrame copy and ref…
Browse files Browse the repository at this point in the history
…erence reset

Signed-off-by: seolmin <[email protected]>
  • Loading branch information
stat-kwon committed Dec 11, 2024
1 parent f9e7cbe commit 6ddfc6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def load(
self.error_message = e.message if hasattr(e, "message") else str(e)
_LOGGER.error(f"[load] add {self.source_type} source error: {e}")

return self.df
df = self.df.copy(deep=True)
self.df = None
return df

def _analyze_asset(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def load(
self.error_message = e.message if hasattr(e, "message") else str(e)
_LOGGER.error(f"[load] {self.operator} operation error: {e}")

return self.df
df = self.df.copy(deep=True)
self.df = None
return df

def join_data_tables(
self,
Expand Down Expand Up @@ -500,6 +502,7 @@ def _get_data_table(
data_table_vo.widget_id,
data_table_vo.domain_id,
)

return ds_mgr.load(granularity, start, end, vars)

def _get_data_table_from_options(
Expand Down

0 comments on commit 6ddfc6e

Please sign in to comment.