Skip to content

Commit 06d8c9c

Browse files
committed
fix union
Signed-off-by: nemirorox <yolandawu131@gmail.com>
1 parent 65ae8f1 commit 06d8c9c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

federatedml/statistic/union/union.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ def check_is_data_instance(self, table):
9797
self.is_data_instance = isinstance(entry[1], Instance)
9898

9999
def fit(self, data):
100-
if len(data) <= 0:
100+
if data is None:
101101
LOGGER.warning("Union receives no data input.")
102102
return
103+
if not isinstance(data, dict):
104+
data = {"data": data}
103105
empty_count = 0
104106
combined_table = None
105107
combined_schema = None
@@ -156,7 +158,6 @@ def fit(self, data):
156158
metric_name=self.metric_name,
157159
metric_meta=MetricMeta(name=self.metric_name, metric_type=self.metric_type))
158160

159-
LOGGER.debug("after union schema: {}".format(combined_table.schema))
160-
161161
LOGGER.info("Union operation finished. Total {} empty tables encountered.".format(empty_count))
162162
return combined_table
163+

0 commit comments

Comments
 (0)