!3369 Init CSV column default list when it's empty

Merge pull request !3369 from jiangzhiwen/fix_column_default
This commit is contained in:
mindspore-ci-bot 2020-07-24 15:40:55 +08:00 committed by Gitee
commit 50e5c7bf82
1 changed files with 5 additions and 0 deletions

View File

@ -758,6 +758,11 @@ Status CsvOp::ComputeColMap() {
} else {
MS_LOG(WARNING) << "Column name map is already set!";
}
if (column_default_list_.size() < column_name_id_map_.size()) {
for (int32_t i = column_default_list_.size(); i < column_name_id_map_.size(); i++) {
column_default_list_.push_back(std::make_shared<CsvOp::Record<std::string>>(CsvOp::STRING, ""));
}
}
return Status::OK();
}
} // namespace dataset