From 06d8c9cc34fd8e0e8b5e56faeacaf99ece5dac3f Mon Sep 17 00:00:00 2001 From: nemirorox Date: Thu, 19 Mar 2020 17:56:37 +0800 Subject: [PATCH] fix union Signed-off-by: nemirorox --- federatedml/statistic/union/union.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/federatedml/statistic/union/union.py b/federatedml/statistic/union/union.py index 3b150707ba..3020b4f069 100644 --- a/federatedml/statistic/union/union.py +++ b/federatedml/statistic/union/union.py @@ -97,9 +97,11 @@ def check_is_data_instance(self, table): self.is_data_instance = isinstance(entry[1], Instance) def fit(self, data): - if len(data) <= 0: + if data is None: LOGGER.warning("Union receives no data input.") return + if not isinstance(data, dict): + data = {"data": data} empty_count = 0 combined_table = None combined_schema = None @@ -156,7 +158,6 @@ def fit(self, data): metric_name=self.metric_name, metric_meta=MetricMeta(name=self.metric_name, metric_type=self.metric_type)) - LOGGER.debug("after union schema: {}".format(combined_table.schema)) - LOGGER.info("Union operation finished. Total {} empty tables encountered.".format(empty_count)) return combined_table +