Skip to content

Commit

Permalink
move messages
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Oct 23, 2023
1 parent ea32bf2 commit 9c10052
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions HICPlugin/DataFlowComponents/CHIColumnFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,29 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener
$"You have chosen the following columns to be ignored: {IgnoreColumns}"));

var columns = toProcess.Columns.Cast<DataColumn>().Where(c => !_columnGreenList.Contains(c.ColumnName.Trim())).Select(c => c.ColumnName.ToString());

string[] messages = new string[] {};
Parallel.For(0, toProcess.Rows.Count, i =>
{
foreach(string col in columns)
foreach (string col in columns)
{
string val = toProcess.Rows[i].Field<string>(col).ToString();
if (ContainsValidChi(val))
{
var message =
$"Column {col} in Dataset {toProcess.TableName} appears to contain a CHI ({val})";
listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning, message));
if (!_isTableAlreadyNamed)
listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning,
"DataTable has not been named. If you want to know the dataset that the error refers to please add an ExtractCatalogueMetadata to the extraction pipeline."));
messages.Append(message);
//listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning, message));
//if (!_isTableAlreadyNamed)
// listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning,
// "DataTable has not been named. If you want to know the dataset that the error refers to please add an ExtractCatalogueMetadata to the extraction pipeline."));
}
}
});
foreach(string message in messages)
{
listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning, message));
}
);

//foreach(var col in toProcess.Columns.Cast<DataColumn>().Where(c => !_columnGreenList.Contains(c.ColumnName.Trim())))
//{
// foreach (var reffedVal in toProcess.Rows.Cast<DataRow>())//.Select(DeRef).Where(ContainsValidChi))
Expand Down

0 comments on commit 9c10052

Please sign in to comment.