!8754 Fix test team issues for python API

From: @alex-yuyue
Reviewed-by: 
Signed-off-by:
This commit is contained in:
mindspore-ci-bot 2020-11-20 02:06:16 +08:00 committed by Gitee
commit 79e5521ae6
4 changed files with 10 additions and 13 deletions

View File

@ -313,7 +313,7 @@ Status DatasetOp::GetNumClasses(int64_t *num_classes) {
return child_[0]->GetNumClasses(num_classes);
} else {
*num_classes = -1;
RETURN_STATUS_UNEXPECTED("Can't get the number of classes for the current tree.");
return Status::OK();
}
}

View File

@ -173,11 +173,15 @@ Status ValidateDatasetColumnParam(const std::string &dataset_name, const std::st
RETURN_STATUS_SYNTAX_ERROR(err_msg);
}
}
std::set<std::string> columns_set(columns.begin(), columns.end());
if (columns_set.size() != columns.size()) {
std::string err_msg = dataset_name + ":" + column_param + ": Every column name should not be same with others";
MS_LOG(ERROR) << err_msg;
RETURN_STATUS_SYNTAX_ERROR(err_msg);
std::set<std::string> columns_set;
for (auto &column_name : columns) {
auto result = columns_set.insert(column_name);
if (result.second == false) {
std::string err_msg = dataset_name + ":" + column_param +
": Invalid parameter, duplicate column names are not allowed: " + *result.first;
MS_LOG(ERROR) << err_msg;
RETURN_STATUS_SYNTAX_ERROR(err_msg);
}
}
return Status::OK();
}

View File

@ -128,7 +128,6 @@ class DatasetNode : public std::enable_shared_from_this<DatasetNode> {
protected:
std::vector<std::shared_ptr<DatasetNode>> children;
std::shared_ptr<DatasetNode> parent;
std::shared_ptr<DatasetCache> cache_;
Status AddCacheOp(std::vector<std::shared_ptr<DatasetOp>> *node_ops);

View File

@ -50,12 +50,6 @@ Status SyncWaitNode::ValidateParams() {
RETURN_STATUS_SYNTAX_ERROR(err_msg);
}
if (condition_name_.empty()) {
std::string err_msg = "SyncWaitNode: condition_name must not be empty.";
MS_LOG(ERROR) << err_msg;
RETURN_STATUS_SYNTAX_ERROR(err_msg);
}
return Status::OK();
}