8000 Merge pull request #1 from asmirnov82/novelhawk_6829 · dotnet/machinelearning@7c07dc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c07dc9

Browse files
authored
Merge pull request #1 from asmirnov82/novelhawk_6829
Add files generated from tt scripts and fix unit tests
2 parents 055c9a8 + b3f5534 commit 7c07dc9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ internal PrimitiveDataFrameColumn<bool> ElementwiseEqualsImplementation<U>(U val
19551955
{
19561956
throw new NotSupportedException();
19571957
}
1958-
return new BooleanDataFrameColumn(Name, (this as PrimitiveDataFrameColumn<bool>)._columnContainer.ElementwiseEquals(Unsafe.As<U, bool>(ref value)));
1958+
return new BooleanDataFrameColumn(Name, (this as PrimitiveDataFrameColumn<DateTime>)._columnContainer.ElementwiseEquals(Unsafe.As<U, DateTime>(ref value)));
19591959
case Type byteType when byteType == typeof(byte):
19601960
case Type charType when charType == typeof(char):
19611961
case Type doubleType when doubleType == typeof(double):
@@ -2102,7 +2102,7 @@ internal PrimitiveDataFrameColumn<bool> ElementwiseNotEqualsImplementation<U>(U
21022102
{
21032103
throw new NotSupportedException();
21042104
}
2105-
return new BooleanDataFrameColumn(Name, (this as PrimitiveDataFrameColumn<bool>)._columnContainer.ElementwiseNotEquals(Unsafe.As<U, bool>(ref value)));
2105+
return new BooleanDataFrameColumn(Name, (this as PrimitiveDataFrameColumn<DateTime>)._columnContainer.ElementwiseNotEquals(Unsafe.As<U, DateTime>(ref value)));
21062106
case Type byteType when byteType == typeof(byte):
21072107
case Type charType when charType == typeof(char):
21082108
case Type doubleType when doubleType == typeof(double):

test/Microsoft.Data.Analysis.Tests/DataFrameTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,15 +625,17 @@ public void TestBinaryOperationsOnDateTimeColumn()
625625
Assert.True(equalsResult[0]);
626626
Assert.False(equalsResult[4]);
627627

628-
var equalsByDataFrameResult = df["DateTime1"].ElementwiseEquals(dataFrameColumn2);
629-
Assert.Equal(equalsResult, equalsByDataFrameResult);
628+
var equalsToScalarResult = df["DateTime1"].ElementwiseEquals(SampleDateTime);
629+
Assert.True(equalsToScalarResult[0]);
630+
Assert.False(equalsToScalarResult[1]);
630631

631632
var notEqualsResult = dataFrameColumn1.ElementwiseNotEquals(dataFrameColumn2);
632633
Assert.False(notEqualsResult[0]);
633634
Assert.True(notEqualsResult[4]);
634635

635-
var notEqualsByDataFrameResult = df["DateTime1"].ElementwiseNotEquals(dataFrameColumn2);
636-
Assert.Equal(notEqualsResult, notEqualsByDataFrameResult);
636+
var notEqualsToScalarResult = df["DateTime1"].ElementwiseNotEquals(SampleDateTime);
637+
Assert.False(notEqualsToScalarResult[0]);
638+
Assert.True(notEqualsToScalarResult[1]);
637639
}
638640

639641
[Fact]

0 commit comments

Comments
 (0)
0