Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Equals and = operator for DataViewType comparison #5942

Merged
merged 1 commit into from Oct 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Microsoft.ML.AutoML/Utils/UserInputValidationUtil.cs
Expand Up @@ -102,7 +102,7 @@ private static void ValidateTrainData(IDataView trainData, ColumnInformation col
}
}

private static void ValidateColumnInformation(IDataView trainData, ColumnInformation columnInformation, TaskKind task)
private static void ValidateColumnInformation(IDataView trainData, ColumnInformation columnInformation, TaskKind task)
{
ValidateColumnInformation(columnInformation);
ValidateTrainDataColumn(trainData, columnInformation.LabelColumnName, LabelColumnPurposeName, GetAllowedLabelTypes(task));
Expand Down Expand Up @@ -217,7 +217,7 @@ private static void ValidateValidationData(IDataView trainData, IDataView valida
throw new ArgumentException($"{schemaMismatchError} Column '{trainCol.Name}' exists in train data, but not in validation data.", nameof(validationData));
}

if (trainCol.Type != validCol.Value.Type)
if (trainCol.Type != validCol.Value.Type && !trainCol.Type.Equals(validCol.Value.Type))
{
throw new ArgumentException($"{schemaMismatchError} Column '{trainCol.Name}' is of type {trainCol.Type} in train data, and type " +
$"{validCol.Value.Type} in validation data.", nameof(validationData));
Expand Down Expand Up @@ -260,7 +260,7 @@ private static void ValidateTrainDataColumn(IDataView trainData, string columnNa
throw new ArgumentException(exceptionMessage);
}

if(allowedTypes == null)
if (allowedTypes == null)
{
return;
}
Expand Down