Skip to content

Commit

Permalink
fix: delete debug code for JOIN operator
Browse files Browse the repository at this point in the history
Signed-off-by: seolmin <seolmin@megazone.com>
  • Loading branch information
stat-kwon committed Dec 23, 2024
1 parent a80423e commit c53161a
Showing 1 changed file with 25 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,31 +91,31 @@ def load(
end: str = None,
vars: dict = None,
) -> pd.DataFrame:
# try:
if self.operator == "JOIN":
self.join_data_tables(granularity, start, end, vars)
elif self.operator == "CONCAT":
self.concat_data_tables(granularity, start, end, vars)
elif self.operator == "AGGREGATE":
self.aggregate_data_table(granularity, start, end, vars)
elif self.operator == "QUERY":
self.query_data_table(granularity, start, end, vars)
elif self.operator == "EVAL":
self.evaluate_data_table(granularity, start, end, vars)
elif self.operator == "PIVOT":
self.pivot_data_table(granularity, start, end, vars)
elif self.operator == "ADD_LABELS":
self.add_labels_data_table(granularity, start, end, vars)
elif self.operator == "VALUE_MAPPING":
self.value_mapping_data_table(granularity, start, end, vars)

self.state = "AVAILABLE"
self.error_message = None

# except Exception as e:
# self.state = "UNAVAILABLE"
# self.error_message = e.message if hasattr(e, "message") else str(e)
# _LOGGER.error(f"[load] {self.operator} operation error: {e}")
try:
if self.operator == "JOIN":
self.join_data_tables(granularity, start, end, vars)
elif self.operator == "CONCAT":
self.concat_data_tables(granularity, start, end, vars)
elif self.operator == "AGGREGATE":
self.aggregate_data_table(granularity, start, end, vars)
elif self.operator == "QUERY":
self.query_data_table(granularity, start, end, vars)
elif self.operator == "EVAL":
self.evaluate_data_table(granularity, start, end, vars)
elif self.operator == "PIVOT":
self.pivot_data_table(granularity, start, end, vars)
elif self.operator == "ADD_LABELS":
self.add_labels_data_table(granularity, start, end, vars)
elif self.operator == "VALUE_MAPPING":
self.value_mapping_data_table(granularity, start, end, vars)

self.state = "AVAILABLE"
self.error_message = None

except Exception as e:
self.state = "UNAVAILABLE"
self.error_message = e.message if hasattr(e, "message") else str(e)
_LOGGER.error(f"[load] {self.operator} operation error: {e}")

return self.df

Expand All @@ -135,9 +135,7 @@ def join_data_tables(
origin_vo = self.data_table_vos[0]
other_vo = self.data_table_vos[1]
origin_df = self._get_data_table(origin_vo, granularity, start, end, vars)
_LOGGER.debug(f"[join_data_tables] origin_df columns: {origin_df.columns}")
other_df = self._get_data_table(other_vo, granularity, start, end, vars)
_LOGGER.debug(f"[join_data_tables] other_df columns: {other_df.columns}")

self._validate_join_keys(left_keys, right_keys, origin_vo, other_vo)

Expand All @@ -146,7 +144,6 @@ def join_data_tables(
merged_df = self._merge_data_frames(
origin_df, other_df, how, left_keys, right_keys
)
_LOGGER.debug(f"[join_data_tables] merged_df columns: {merged_df.columns}")
merged_df = self._rename_duplicated_columns(
merged_df, origin_vo.name, other_vo.name
)
Expand Down

0 comments on commit c53161a

Please sign in to comment.