Skip to content

Commit ecb9114

Browse files
committed
Merge branch 'main' into 6182_load_csv_duplicate_columns
2 parents 375939d + a823199 commit ecb9114

File tree

64 files changed

+91639
-1372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+91639
-1372
lines changed

build/ci/job-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
steps:
6969
# Extra MacOS step required to install OS-specific dependencies
7070
- ${{ if and(contains(parameters.pool.vmImage, 'macOS'), not(contains(parameters.name, 'cross'))) }}:
71-
- script: export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=TRUE && brew update && brew unlink libomp && brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula
71+
- script: export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=TRUE && brew unlink libomp && brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula
7272
displayName: Install MacOS build dependencies
7373
# Extra Apple MacOS step required to install OS-specific dependencies
7474
- ${{ if and(contains(parameters.pool.vmImage, 'macOS'), contains(parameters.name, 'cross')) }}:

build/vsts-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ stages:
100100
pool:
101101
vmImage: macOS-12
102102
steps:
103-
- script: export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 && brew update && rm '/usr/local/bin/2to3-3.11' && brew unlink libomp && brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula
103+
- script: export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 && rm '/usr/local/bin/2to3-3.11' && brew unlink libomp && brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula
104104
displayName: Install build dependencies
105105
# Only build native assets to avoid conflicts.
106106
- script: ./build.sh -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=x64 /p:CopyPackageAssets=true

src/Microsoft.Data.Analysis/ColumnArithmeticTemplate.ttinclude

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,7 @@
354354
{
355355
return GetColumnSpecificMethodComments().Replace(" an", " a reversed");
356356
}
357-
358-
public string GetMethodSignature(string columnType, string genericType)
359-
{
360-
var arguments = GetMethodArguments(columnType, genericType);
361-
return $"void {MethodName}({arguments})";
362-
}
363-
357+
364358
public string GetInvertedMethodSignatureForBinaryScalarsOps(string columnType, string genericType)
365359
{
366360
var arguments = GetInvertedMethodArguments(columnType, genericType);
@@ -406,15 +400,13 @@
406400
case MethodType.UnaryInPlace:
407401
return $"{dataFrameType}<{genericType}> {Op1Name}";
408402
case MethodType.BinaryScalar:
409-
return $"{dataFrameType}<{genericType}> {Op1Name}, {genericType} {Op2Name}";
410403
case MethodType.ComparisonScalar:
411-
return $"{dataFrameType}<{genericType}> {Op1Name}, {genericType} {Op2Name}, {dataFrameType}<bool> ret";
404+
return $"{dataFrameType}<{genericType}> {Op1Name}, {genericType} {Op2Name}";
412405
case MethodType.BinaryInt:
413406
return $"{dataFrameType}<{genericType}> {Op1Name}, int {Op2Name}";
414407
case MethodType.Binary:
415-
return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}";
416408
case MethodType.Comparison:
417-
return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}, {dataFrameType}<bool> ret";
409+
return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}";
418410
case MethodType.Contraction:
419411
return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}, int[] leftAxes, int[] rightAxes";
420412
case MethodType.ElementwiseComputation:
@@ -432,20 +424,16 @@
432424
case MethodType.Unary:
433425
case MethodType.UnaryInPlace:
434426
throw new ArgumentException();
435-
return $"{dataFrameType}<{genericType}> {Op1Name}";
436427
case MethodType.BinaryScalar:
437-
return $"{genericType} {Op2Name}";
438428
case MethodType.ComparisonScalar:
439-
return $"{genericType} {Op2Name}, {dataFrameType}<bool> ret";
429+
return $"{genericType} {Op2Name}";
440430
case MethodType.BinaryInt:
441431
return $"int {Op2Name}";
442432
case MethodType.Binary:
443-
return $"{dataFrameType}<{genericType}> {Op2Name}";
444433
case MethodType.Comparison:
445-
return $"{dataFrameType}<{genericType}> {Op2Name}, {dataFrameType}<bool> ret";
434+
return $"{dataFrameType}<{genericType}> {Op2Name}";
446435
case MethodType.Contraction:
447436
throw new ArgumentException();
448-
return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}, int[] leftAxes, int[] rightAxes";
449437
default:
450438
throw new ArgumentException();
451439
}
@@ -456,4 +444,4 @@
456444
public bool HasReturnValue { get; }
457445
public bool SupportsRowSubsets { get; }
458446
}
459-
#>
447+
#>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,4 +332,4 @@ public virtual PrimitiveDataFrameColumn<bool> ElementwiseIsNotNull()
332332
throw new NotImplementedException();
333333
}
334334
}
335-
}
335+
}

src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperations.tt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,20 @@ namespace Microsoft.Data.Analysis
7878

7979
<# } #>
8080
<# } #>
81+
/// <summary>
82+
/// Performs an element-wise equal to Null on each value in the column
83+
/// </summary>
8184
public virtual PrimitiveDataFrameColumn<bool> ElementwiseIsNull()
8285
{
8386
throw new NotImplementedException();
8487
}
8588

89+
/// <summary>
90+
/// Performs an element-wise not equal to Null on each value in the column
91+
/// </summary>
8692
public virtual PrimitiveDataFrameColumn<bool> ElementwiseIsNotNull()
8793
{
8894
throw new NotImplementedException();
8995
}
9096
}
91-
}
97+
}

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

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Microsoft.Data.Analysis
1010
internal partial class PrimitiveColumnContainer<T>
1111
where T : unmanaged
1212
{
13+
1314
public PrimitiveColumnContainer<T> Add(PrimitiveColumnContainer<T> right)
1415
{
1516
PrimitiveDataFrameColumnArithmetic<T>.Instance.Add(this, right);
@@ -118,117 +119,112 @@ public PrimitiveColumnContainer<T> RightShift(int value)
118119
return this;
119120
}
120121

121-
public PrimitiveColumnContainer<T> ElementwiseEquals(PrimitiveColumnContainer<T> right, PrimitiveColumnContainer<bool> ret)
122+
public PrimitiveColumnContainer<bool> ElementwiseEquals(PrimitiveColumnContainer<T> right)
122123
{
123-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseEquals(this, right, ret);
124-
return this;
124+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseEquals(this, right);
125125
}
126126

127-
public PrimitiveColumnContainer<T> ElementwiseEquals(T scalar, PrimitiveColumnContainer<bool> ret)
127+
public PrimitiveColumnContainer<bool> ElementwiseEquals(T scalar)
128128
{
129-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseEquals(this, scalar, ret);
130-
return this;
129+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseEquals(this, scalar);
131130
}
132131

133-
public PrimitiveColumnContainer<T> ElementwiseNotEquals(PrimitiveColumnContainer<T> right, PrimitiveColumnContainer<bool> ret)
132+
public PrimitiveColumnContainer<bool> ElementwiseNotEquals(PrimitiveColumnContainer<T> right)
134133
{
135-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseNotEquals(this, right, ret);
136-
return this;
134+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseNotEquals(this, right);
137135
}
138136

139-
public PrimitiveColumnContainer<T> ElementwiseNotEquals(T scalar, PrimitiveColumnContainer<bool> ret)
137+
public PrimitiveColumnContainer<bool> ElementwiseNotEquals(T scalar)
140138
{
141-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseNotEquals(this, scalar, ret);
142-
return this;
139+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseNotEquals(this, scalar);
143140
}
144141

145-
public PrimitiveColumnContainer<T> ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer<T> right, PrimitiveColumnContainer<bool> ret)
142+
public PrimitiveColumnContainer<bool> ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer<T> right)
146143
{
147-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThanOrEqual(this, right, ret);
148-
return this;
144+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThanOrEqual(this, right);
149145
}
150146

151-
public PrimitiveColumnContainer<T> ElementwiseGreaterThanOrEqual(T scalar, PrimitiveColumnContainer<bool> ret)
147+
public PrimitiveColumnContainer<bool> ElementwiseGreaterThanOrEqual(T scalar)
152148
{
153-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThanOrEqual(this, scalar, ret);
154-
return this;
149+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThanOrEqual(this, scalar);
155150
}
156151

157-
public PrimitiveColumnContainer<T> ElementwiseLessThanOrEqual(PrimitiveColumnContainer<T> right, PrimitiveColumnContainer<bool> ret)
152+
public PrimitiveColumnContainer<bool> ElementwiseLessThanOrEqual(PrimitiveColumnContainer<T> right)
158153
{
159-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThanOrEqual(this, right, ret);
160-
return this;
154+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThanOrEqual(this, right);
161155
}
162156

163-
public PrimitiveColumnContainer<T> ElementwiseLessThanOrEqual(T scalar, PrimitiveColumnContainer<bool> ret)
157+
public PrimitiveColumnContainer<bool> ElementwiseLessThanOrEqual(T scalar)
164158
{
165-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThanOrEqual(this, scalar, ret);
166-
return this;
159+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThanOrEqual(this, scalar);
167160
}
168161

169-
public PrimitiveColumnContainer<T> ElementwiseGreaterThan(PrimitiveColumnContainer<T> right, PrimitiveColumnContainer<bool> ret)
162+
public PrimitiveColumnContainer<bool> ElementwiseGreaterThan(PrimitiveColumnContainer<T> right)
170163
{
171-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThan(this, right, ret);
172-
return this;
164+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThan(this, right);
173165
}
174166

175-
public PrimitiveColumnContainer<T> ElementwiseGreaterThan(T scalar, PrimitiveColumnContainer<bool> ret)
167+
public PrimitiveColumnContainer<bool> ElementwiseGreaterThan(T scalar)
176168
{
177-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThan(this, scalar, ret);
178-
return this;
169+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseGreaterThan(this, scalar);
179170
}
180171

181-
public PrimitiveColumnContainer<T> ElementwiseLessThan(PrimitiveColumnContainer<T> right, PrimitiveColumnContainer<bool> ret)
172+
public PrimitiveColumnContainer<bool> ElementwiseLessThan(PrimitiveColumnContainer<T> right)
182173
{
183-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThan(this, right, ret);
184-
return this;
174+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThan(this, right);
185175
}
186176

187-
public PrimitiveColumnContainer<T> ElementwiseLessThan(T scalar, PrimitiveColumnContainer<bool> ret)
177+
public PrimitiveColumnContainer<bool> ElementwiseLessThan(T scalar)
188178
{
189-
PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThan(this, scalar, ret);
190-
return this;
179+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.ElementwiseLessThan(this, scalar);
191180
}
192181

193182
public PrimitiveColumnContainer<T> ReverseAdd(T scalar)
194183
{
195184
PrimitiveDataFrameColumnArithmetic<T>.Instance.Add(scalar, this);
196185
return this;
197186
}
187+
198188
public PrimitiveColumnContainer<T> ReverseSubtract(T scalar)
199189
{
200190
PrimitiveDataFrameColumnArithmetic<T>.Instance.Subtract(scalar, this);
201191
return this;
202192
}
193+
203194
public PrimitiveColumnContainer<T> ReverseMultiply(T scalar)
204195
{
205196
PrimitiveDataFrameColumnArithmetic<T>.Instance.Multiply(scalar, this);
206197
return this;
207198
}
199+
208200
public PrimitiveColumnContainer<T> ReverseDivide(T scalar)
209201
{
210202
PrimitiveDataFrameColumnArithmetic<T>.Instance.Divide(scalar, this);
211203
return this;
212204
}
205+
213206
public PrimitiveColumnContainer<T> ReverseModulo(T scalar)
214207
{
215208
PrimitiveDataFrameColumnArithmetic<T>.Instance.Modulo(scalar, this);
216209
return this;
217210
}
211+
218212
public PrimitiveColumnContainer<T> ReverseAnd(T scalar)
219213
{
220214
PrimitiveDataFrameColumnArithmetic<T>.Instance.And(scalar, this);
221215
return this;
222216
}
217+
223218
public PrimitiveColumnContainer<T> ReverseOr(T scalar)
224219
{
225220
PrimitiveDataFrameColumnArithmetic<T>.Instance.Or(scalar, this);
226221
return this;
227222
}
223+
228224
public PrimitiveColumnContainer<T> ReverseXor(T scalar)
229225
{
230226
PrimitiveDataFrameColumnArithmetic<T>.Instance.Xor(scalar, this);
231227
return this;
232228
}
233229
}
234-
}
230+
}

src/Microsoft.Data.Analysis/PrimitiveColumnContainer.BinaryOperations.tt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
namespace Microsoft.Data.Analysis
1515
{
1616
internal partial class PrimitiveColumnContainer<T>
17-
where T : struct
17+
where T : unmanaged
1818
{
1919
<# foreach (MethodConfiguration method in methodConfiguration) { #>
20-
<# if (method.MethodType == MethodType.Comparison || method.MethodType == MethodType.ComparisonScalar) { #>
21-
public <#= method.GetSingleArgumentMethodSignature("PrimitiveColumnContainer", "T") #>
20+
21+
<# if (method.MethodType == MethodType.Comparison) { #>
22+
public PrimitiveColumnContainer<bool> <#=method.MethodName#>(PrimitiveColumnContainer<T> right)
2223
{
23-
<# if (method.MethodType == MethodType.ComparisonScalar ) { #>
24-
PrimitiveDataFrameColumnArithmetic<T>.Instance.<#=method.MethodName#>(this, scalar, ret);
25-
<# } else { #>
26-
PrimitiveDataFrameColumnArithmetic<T>.Instance.<#=method.MethodName#>(this, right, ret);
27-
<# } #>
28-
return this;
24+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.<#=method.MethodName#>(this, right);
25+
}
26+
<# } else if (method.MethodType == MethodType.ComparisonScalar ) { #>
27+
public PrimitiveColumnContainer<bool> <#=method.MethodName#>(T scalar)
28+
{
29+
return PrimitiveDataFrameColumnArithmetic<T>.Instance.<#=method.MethodName#>(this, scalar);
2930
}
30-
3131
<# } else { #>
3232
public <#= method.GetSingleArgumentMethodSignature("PrimitiveColumnContainer", "T")#>
3333
{
@@ -40,11 +40,11 @@ namespace Microsoft.Data.Analysis
4040
<# } #>
4141
return this;
4242
}
43-
4443
<# } #>
4544
<# } #>
4645
<# foreach (MethodConfiguration method in methodConfiguration) { #>
4746
<# if (method.MethodType == MethodType.BinaryScalar) { #>
47+
4848
public PrimitiveColumnContainer<T> Reverse<#=method.MethodName#>(T scalar)
4949
{
5050
PrimitiveDataFrameColumnArithmetic<T>.Instance.<#=method.MethodName#>(scalar, this);
@@ -53,4 +53,4 @@ namespace Microsoft.Data.Analysis
5353
<# } #>
5454
<# } #>
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)