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

Add targeting .Net 8.0 for DataFrame package #7168

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<SystemTextJsonVersion>6.0.1</SystemTextJsonVersion>
<SystemThreadingChannelsVersion>4.7.1</SystemThreadingChannelsVersion>
<!-- Other product dependencies -->
<ApacheArrowVersion>11.0.0</ApacheArrowVersion>
<ApacheArrowVersion>14.0.2</ApacheArrowVersion>
<GoogleProtobufVersion>3.19.6</GoogleProtobufVersion>
<LightGBMVersion>3.3.5</LightGBMVersion>
<MicrosoftBclHashCodeVersion>1.1.1</MicrosoftBclHashCodeVersion>
Expand Down
9 changes: 6 additions & 3 deletions src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SuppressFinalPackageVersion>false</SuppressFinalPackageVersion>
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -45,13 +45,16 @@
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Apache.Arrow" Version="$(ApacheArrowVersion)" />
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafeVersion)" />
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Apache.Arrow" Version="$(ApacheArrowVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.ML.DataView\Microsoft.ML.DataView.csproj" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions test/Microsoft.Data.Analysis.Tests/ArrayComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ public static bool Equals(Schema s1, Schema s2)
{
return true;
}
if (s2 == null || s1 == null || s1.HasMetadata != s2.HasMetadata || s1.Fields.Count != s2.Fields.Count)
if (s2 == null || s1 == null || s1.HasMetadata != s2.HasMetadata || s1.FieldsList.Count != s2.FieldsList.Count)
{
return false;
}

if (!s1.Fields.Keys.All(k => s2.Fields.ContainsKey(k) && FieldComparer.Equals(s1.Fields[k], s2.Fields[k])) ||
!s2.Fields.Keys.All(k => s1.Fields.ContainsKey(k) && FieldComparer.Equals(s2.Fields[k], s1.Fields[k])))
if (!s1.FieldsList.All(field => s2.FieldsLookup.Contains(field.Name) && FieldComparer.Equals(field, s2.GetFieldByName(field.Name))) ||
!s2.FieldsList.All(field => s1.FieldsLookup.Contains(field.Name) && FieldComparer.Equals(field, s1.GetFieldByName(field.Name))))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ RecordBatch CreateRecordBatch(string prependColumnNamesWith = "")
}
ArrowBuffer validityBitmap = validityBitmapBuilder.Build();

StructType structType = new StructType(originalBatch.Schema.Fields.Select((KeyValuePair<string, Field> pair) => pair.Value).ToList());
StructType structType = new StructType(originalBatch.Schema.FieldsList);
StructArray structArray = new StructArray(structType, originalBatch.Length, originalBatch.Arrays.Cast<Apache.Arrow.Array>(), validityBitmap);
Schema schema = new Schema.Builder().Field(new Field("Struct", structType, false)).Build();
RecordBatch recordBatch = new RecordBatch(schema, new[] { structArray }, originalBatch.Length);
Expand Down