Skip to content

Commit

Permalink
fix cast
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Oct 23, 2023
1 parent 5c81b06 commit 8b25044
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions HICPlugin/DataFlowComponents/CHIColumnFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener
listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information,
$"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());
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(var row in toProcess.Rows.Cast<DataRow>())
{
foreach (string col in columns)
foreach (DataColumn col in columns)
{
string val = row.Field<string>(col).ToString();
string val = row[col].ToString(); //row.Field<string>(col).ToString();
if (ContainsValidChi(val))
{
var message =
$"Column {col} in Dataset {toProcess.TableName} appears to contain a CHI ({val})";
$"Column {col.ColumnName} in Dataset {toProcess.TableName} appears to contain a CHI ({val})";
messages.Append(message);
//listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning, message));
//if (!_isTableAlreadyNamed)
Expand Down

0 comments on commit 8b25044

Please sign in to comment.