Skip to content
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

Fix Bugs #63

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def __init__(
self.domain_id = domain_id

self.data_name = options.get("data_name")
if self.data_name is None:
raise ERROR_REQUIRED_PARAMETER(key="options.data_name")

self.data_unit = options.get("data_unit")
self.date_format = options.get("date_format", "SINGLE")
self.timediff = options.get("timediff")
Expand All @@ -47,9 +50,6 @@ def __init__(
self.additional_labels = options.get("additional_labels")

def get_data_and_labels_info(self) -> Tuple[dict, dict]:
if self.data_name is None:
raise ERROR_REQUIRED_PARAMETER(key="options.data_name")

data_info = {self.data_name: {}}

if self.data_unit:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ def join_data_tables(
origin_df = self._get_data_table(origin_vo, granularity, start, end, vars)
other_df = self._get_data_table(other_vo, granularity, start, end, vars)

if len(other_df) == 0:
if how in ["left", "outer"]:
self.df = origin_df
else:
self.df = other_df
return
elif len(origin_df) == 0:
if how in ["right", "outer"]:
self.df = other_df
else:
self.df = origin_df
return

merged_df = origin_df.merge(other_df, left_on=on, right_on=on, how=how)
merged_df = merged_df.fillna(value=fill_na)
self.df = merged_df
Expand Down
Loading