Skip to content

Commit

Permalink
Nullable classifiers get placeholder value (temporarily).
Browse files Browse the repository at this point in the history
  • Loading branch information
mfellows committed Aug 1, 2024
1 parent 02003a0 commit 26628dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/moja.modules.cbm/src/flatrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace cbm {

valueStr += (boost::format("%1%%2%%3%") % quote % currentValue % quote).str();
} else {
valueStr += "NULL";
valueStr += "'NA'";
}

classifierStr += valueStr;
Expand Down Expand Up @@ -132,7 +132,7 @@ namespace cbm {
% _year % classifierStr % _landClass % _ageClass % previousClassifierStr % _previousLandClass
% _previousAgeClass % (_disturbanceType.isNull() || _disturbanceType == "" ? "NULL" : ((boost::format("'%1%'") % _disturbanceType.value()).str()))
% (_disturbanceCode.isNull() ? "NULL" : pqxx::to_string(_disturbanceCode.value()))
% _srcPool % _dstPool % pqxx::to_string(_flux)).str();
% _srcPool % _dstPool % _flux).str();
}
}

Expand Down Expand Up @@ -216,7 +216,7 @@ namespace cbm {
auto classifierStr = FlatRecordHelper::BuildClassifierValueString(_classifierValues, csvFormat);

return (boost::format(csvFormat ? csvRecord : dbRecord)
% _year % classifierStr % _landClass % _ageClass % _pool % pqxx::to_string(_value)).str();
% _year % classifierStr % _landClass % _ageClass % _pool % _value).str();
}

std::vector<std::optional<std::string>> FlatPoolRecord::asVector() const {
Expand Down Expand Up @@ -300,7 +300,7 @@ namespace cbm {
}

return (boost::format(csvFormat ? csvRecord : dbRecord)
% _year % classifierStr % _module % errorStr % pqxx::to_string(_area)).str();
% _year % classifierStr % _module % errorStr % _area).str();
}

std::vector<std::optional<std::string>> FlatErrorRecord::asVector() const {
Expand Down Expand Up @@ -370,7 +370,7 @@ namespace cbm {

auto classifierStr = FlatRecordHelper::BuildClassifierValueString(_classifierValues, csvFormat);

return (boost::format(csvFormat ? csvRecord : dbRecord) % _year % classifierStr % _landClass % _ageClass % pqxx::to_string(_area)).str();
return (boost::format(csvFormat ? csvRecord : dbRecord) % _year % classifierStr % _landClass % _ageClass % _area).str();
}

std::vector<std::optional<std::string>> FlatAgeAreaRecord::asVector() const {
Expand Down Expand Up @@ -467,7 +467,7 @@ namespace cbm {

return (boost::format(csvFormat ? csvRecord : dbRecord)
% _year % classifierStr % _landClass % _ageClass % previousClassifierStr % _previousLandClass
% _previousAgeClass % _disturbanceType % _disturbanceCode % pqxx::to_string(_area)).str();
% _previousAgeClass % _disturbanceType % _disturbanceCode % _area).str();
}

std::vector<std::optional<std::string>> FlatDisturbanceRecord::asVector() const {
Expand Down

0 comments on commit 26628dd

Please sign in to comment.