This is an automated email from the ASF dual-hosted git repository.
CurtHagenlocher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-dotnet.git
The following commit(s) were added to refs/heads/main by this push:
new fbaa39d Cleaned up some odds and ends (#326)
fbaa39d is described below
commit fbaa39dce43ada5be0d2c1e9d871f3a014fb799c
Author: Curt Hagenlocher <[email protected]>
AuthorDate: Thu Apr 23 21:22:37 2026 -0700
Cleaned up some odds and ends (#326)
## What's Changed
Cleaned up some odds and ends:
- Marked projects as AOT-compatible
- Moved some code from `Json` to `VariantJson` for better clarity
- Enabled compression tests on Desktop Framework
---
src/Apache.Arrow.Compression/Apache.Arrow.Compression.csproj | 9 ++-------
src/Apache.Arrow.Flight.Sql/Apache.Arrow.Flight.Sql.csproj | 3 ++-
src/Apache.Arrow.Flight.Sql/Client/FlightSqlClient.cs | 4 ++--
src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj | 3 ++-
src/Apache.Arrow.Operations/Apache.Arrow.Operations.csproj | 2 +-
.../{Json => VariantJson}/VariantJsonConverter.cs | 2 +-
.../{Json => VariantJson}/VariantJsonReader.cs | 2 +-
.../{Json => VariantJson}/VariantJsonWriter.cs | 2 +-
src/Apache.Arrow.Scalars/Apache.Arrow.Scalars.csproj | 2 +-
src/Apache.Arrow/Apache.Arrow.csproj | 2 +-
src/Apache.Arrow/Properties/AssemblyInfo.cs | 1 +
.../Apache.Arrow.Compression.Tests.csproj | 10 ++++++++--
test/Apache.Arrow.Compression.Tests/ArrowStreamReaderTests.cs | 2 +-
.../{Json => VariantJson}/VariantDecimalJsonTests.cs | 2 +-
.../{Json => VariantJson}/VariantJsonTests.cs | 2 +-
test/Apache.Arrow.Variant.Benchmarks/EncodingBenchmarks.cs | 2 +-
16 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/src/Apache.Arrow.Compression/Apache.Arrow.Compression.csproj
b/src/Apache.Arrow.Compression/Apache.Arrow.Compression.csproj
index 352b415..4a428cc 100644
--- a/src/Apache.Arrow.Compression/Apache.Arrow.Compression.csproj
+++ b/src/Apache.Arrow.Compression/Apache.Arrow.Compression.csproj
@@ -1,16 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net8.0;net462</TargetFrameworks>
+ <IsAotCompatible
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net8.0'))">true</IsAotCompatible>
<Description>Provides decompression support for the Arrow IPC
format</Description>
</PropertyGroup>
- <PropertyGroup Condition="'$(IsWindows)'=='true'">
- <TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
- </PropertyGroup>
- <PropertyGroup Condition="'$(IsWindows)'!='true'">
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
- </PropertyGroup>
-
<ItemGroup>
<PackageReference Include="K4os.Compression.LZ4.Streams" />
<PackageReference Include="ZstdSharp.Port" />
diff --git a/src/Apache.Arrow.Flight.Sql/Apache.Arrow.Flight.Sql.csproj
b/src/Apache.Arrow.Flight.Sql/Apache.Arrow.Flight.Sql.csproj
index e696fc8..d98acc4 100644
--- a/src/Apache.Arrow.Flight.Sql/Apache.Arrow.Flight.Sql.csproj
+++ b/src/Apache.Arrow.Flight.Sql/Apache.Arrow.Flight.Sql.csproj
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>netstandard2.1</TargetFramework>
+ <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
+ <IsAotCompatible
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net8.0'))">true</IsAotCompatible>
</PropertyGroup>
<ItemGroup>
diff --git a/src/Apache.Arrow.Flight.Sql/Client/FlightSqlClient.cs
b/src/Apache.Arrow.Flight.Sql/Client/FlightSqlClient.cs
index 98e4b47..8a14853 100644
--- a/src/Apache.Arrow.Flight.Sql/Client/FlightSqlClient.cs
+++ b/src/Apache.Arrow.Flight.Sql/Client/FlightSqlClient.cs
@@ -939,7 +939,7 @@ public class FlightSqlClient
FlightCallOptions? options = default,
CancellationToken cancellationToken = default)
{
- if (transaction == null)
+ if (transaction == default)
throw new ArgumentNullException(nameof(transaction));
try
@@ -965,7 +965,7 @@ public class FlightSqlClient
FlightCallOptions? options = default,
CancellationToken cancellationToken = default)
{
- if (transaction == null)
+ if (transaction == default)
{
throw new ArgumentNullException(nameof(transaction));
}
diff --git a/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj
b/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj
index b3710fb..de5d495 100644
--- a/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj
+++ b/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>netstandard2.0;netstandard2.1;net472</TargetFrameworks>
+ <TargetFrameworks>netstandard2.0;net8.0;net472</TargetFrameworks>
+ <IsAotCompatible
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net8.0'))">true</IsAotCompatible>
</PropertyGroup>
<ItemGroup>
diff --git a/src/Apache.Arrow.Operations/Apache.Arrow.Operations.csproj
b/src/Apache.Arrow.Operations/Apache.Arrow.Operations.csproj
index bb6cb08..c4f0c45 100644
--- a/src/Apache.Arrow.Operations/Apache.Arrow.Operations.csproj
+++ b/src/Apache.Arrow.Operations/Apache.Arrow.Operations.csproj
@@ -3,7 +3,7 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>netstandard2.0;net8.0;net462</TargetFrameworks>
-
+ <IsAotCompatible
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net8.0'))">true</IsAotCompatible>
<Description>Format-specific codecs for the Apache Arrow Variant binary
format, including JSON reader/writer.</Description>
</PropertyGroup>
diff --git a/src/Apache.Arrow.Operations/Json/VariantJsonConverter.cs
b/src/Apache.Arrow.Operations/VariantJson/VariantJsonConverter.cs
similarity index 99%
rename from src/Apache.Arrow.Operations/Json/VariantJsonConverter.cs
rename to src/Apache.Arrow.Operations/VariantJson/VariantJsonConverter.cs
index 8a4c2bf..843cd69 100644
--- a/src/Apache.Arrow.Operations/Json/VariantJsonConverter.cs
+++ b/src/Apache.Arrow.Operations/VariantJson/VariantJsonConverter.cs
@@ -19,7 +19,7 @@ using System.Text.Json;
using System.Text.Json.Serialization;
using Apache.Arrow.Scalars.Variant;
-namespace Apache.Arrow.Operations.Json
+namespace Apache.Arrow.Operations.VariantJson
{
/// <summary>
/// A <see cref="JsonConverter{T}"/> for <see cref="VariantValue"/>.
diff --git a/src/Apache.Arrow.Operations/Json/VariantJsonReader.cs
b/src/Apache.Arrow.Operations/VariantJson/VariantJsonReader.cs
similarity index 99%
rename from src/Apache.Arrow.Operations/Json/VariantJsonReader.cs
rename to src/Apache.Arrow.Operations/VariantJson/VariantJsonReader.cs
index 5f8ada4..e6487f0 100644
--- a/src/Apache.Arrow.Operations/Json/VariantJsonReader.cs
+++ b/src/Apache.Arrow.Operations/VariantJson/VariantJsonReader.cs
@@ -18,7 +18,7 @@ using System.Text;
using System.Text.Json;
using Apache.Arrow.Scalars.Variant;
-namespace Apache.Arrow.Operations.Json
+namespace Apache.Arrow.Operations.VariantJson
{
/// <summary>
/// Parses a JSON string or UTF-8 bytes directly into variant binary format
diff --git a/src/Apache.Arrow.Operations/Json/VariantJsonWriter.cs
b/src/Apache.Arrow.Operations/VariantJson/VariantJsonWriter.cs
similarity index 99%
rename from src/Apache.Arrow.Operations/Json/VariantJsonWriter.cs
rename to src/Apache.Arrow.Operations/VariantJson/VariantJsonWriter.cs
index 56144a9..ff6af3d 100644
--- a/src/Apache.Arrow.Operations/Json/VariantJsonWriter.cs
+++ b/src/Apache.Arrow.Operations/VariantJson/VariantJsonWriter.cs
@@ -23,7 +23,7 @@ using System.Text;
using System.Text.Json;
using Apache.Arrow.Scalars.Variant;
-namespace Apache.Arrow.Operations.Json
+namespace Apache.Arrow.Operations.VariantJson
{
/// <summary>
/// Writes variant binary data directly to JSON without creating
intermediate
diff --git a/src/Apache.Arrow.Scalars/Apache.Arrow.Scalars.csproj
b/src/Apache.Arrow.Scalars/Apache.Arrow.Scalars.csproj
index 3c3bd62..5ab873a 100644
--- a/src/Apache.Arrow.Scalars/Apache.Arrow.Scalars.csproj
+++ b/src/Apache.Arrow.Scalars/Apache.Arrow.Scalars.csproj
@@ -3,7 +3,7 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>netstandard2.0;net8.0;net462</TargetFrameworks>
-
+ <IsAotCompatible
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net8.0'))">true</IsAotCompatible>
<Description>Apache Arrow scalar types, including Parquet-compatible
variants. Provides readers, writers, and object model for the Parquet Variant
binary format for semi-structured data.</Description>
</PropertyGroup>
diff --git a/src/Apache.Arrow/Apache.Arrow.csproj
b/src/Apache.Arrow/Apache.Arrow.csproj
index 1425987..e661964 100644
--- a/src/Apache.Arrow/Apache.Arrow.csproj
+++ b/src/Apache.Arrow/Apache.Arrow.csproj
@@ -3,7 +3,7 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);UNSAFE_BYTEBUFFER;ENABLE_SPAN_T</DefineConstants>
-
+ <IsAotCompatible
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net8.0'))">true</IsAotCompatible>
<Description>Apache Arrow is a cross-language development platform for
in-memory data. It specifies a standardized language-independent columnar
memory format for flat and hierarchical data, organized for efficient analytic
operations on modern hardware.</Description>
</PropertyGroup>
diff --git a/src/Apache.Arrow/Properties/AssemblyInfo.cs
b/src/Apache.Arrow/Properties/AssemblyInfo.cs
index 6b2a7ae..ff12674 100644
--- a/src/Apache.Arrow/Properties/AssemblyInfo.cs
+++ b/src/Apache.Arrow/Properties/AssemblyInfo.cs
@@ -17,3 +17,4 @@ using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Apache.Arrow.Flight,
PublicKey=0024000004800000940000000602000000240000525341310004000001000100e504183f6d470d6b67b6d19212be3e1f598f70c246a120194bc38130101d0c1853e4a0f2232cb12e37a7a90e707aabd38511dac4f25fcb0d691b2aa265900bf42de7f70468fc997551a40e1e0679b605aa2088a4a69e07c117e988f5b1738c570ee66997fba02485e7856a49eca5fd0706d09899b8312577cbb9034599fc92d4")]
[assembly: InternalsVisibleTo("Apache.Arrow.Tests,
PublicKey=0024000004800000940000000602000000240000525341310004000001000100e504183f6d470d6b67b6d19212be3e1f598f70c246a120194bc38130101d0c1853e4a0f2232cb12e37a7a90e707aabd38511dac4f25fcb0d691b2aa265900bf42de7f70468fc997551a40e1e0679b605aa2088a4a69e07c117e988f5b1738c570ee66997fba02485e7856a49eca5fd0706d09899b8312577cbb9034599fc92d4")]
+[assembly: InternalsVisibleTo("Apache.Arrow.Compression.Tests,
PublicKey=0024000004800000940000000602000000240000525341310004000001000100e504183f6d470d6b67b6d19212be3e1f598f70c246a120194bc38130101d0c1853e4a0f2232cb12e37a7a90e707aabd38511dac4f25fcb0d691b2aa265900bf42de7f70468fc997551a40e1e0679b605aa2088a4a69e07c117e988f5b1738c570ee66997fba02485e7856a49eca5fd0706d09899b8312577cbb9034599fc92d4")]
diff --git
a/test/Apache.Arrow.Compression.Tests/Apache.Arrow.Compression.Tests.csproj
b/test/Apache.Arrow.Compression.Tests/Apache.Arrow.Compression.Tests.csproj
index 1a307af..0f25d16 100644
--- a/test/Apache.Arrow.Compression.Tests/Apache.Arrow.Compression.Tests.csproj
+++ b/test/Apache.Arrow.Compression.Tests/Apache.Arrow.Compression.Tests.csproj
@@ -1,11 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>net8.0</TargetFramework>
-
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
<IsPackable>false</IsPackable>
</PropertyGroup>
+ <PropertyGroup Condition="'$(IsWindows)'=='true'">
+ <TargetFrameworks>net8.0;net472;net462</TargetFrameworks>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(IsWindows)'!='true'">
+ <TargetFrameworks>net8.0</TargetFrameworks>
+ </PropertyGroup>
+
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
diff --git a/test/Apache.Arrow.Compression.Tests/ArrowStreamReaderTests.cs
b/test/Apache.Arrow.Compression.Tests/ArrowStreamReaderTests.cs
index e432e37..9c2bf75 100644
--- a/test/Apache.Arrow.Compression.Tests/ArrowStreamReaderTests.cs
+++ b/test/Apache.Arrow.Compression.Tests/ArrowStreamReaderTests.cs
@@ -47,7 +47,7 @@ namespace Apache.Arrow.Compression.Tests
using var stream =
assembly.GetManifestResourceStream($"Apache.Arrow.Compression.Tests.Resources.{fileName}");
Assert.NotNull(stream);
var buffer = new byte[stream.Length];
- stream.ReadExactly(buffer);
+ stream.ReadFullBuffer(buffer);
var codecFactory = new Compression.CompressionCodecFactory();
using var reader = new ArrowStreamReader(buffer, codecFactory);
diff --git a/test/Apache.Arrow.Operations.Tests/Json/VariantDecimalJsonTests.cs
b/test/Apache.Arrow.Operations.Tests/VariantJson/VariantDecimalJsonTests.cs
similarity index 99%
rename from test/Apache.Arrow.Operations.Tests/Json/VariantDecimalJsonTests.cs
rename to
test/Apache.Arrow.Operations.Tests/VariantJson/VariantDecimalJsonTests.cs
index 866f8b2..b9ffeaa 100644
--- a/test/Apache.Arrow.Operations.Tests/Json/VariantDecimalJsonTests.cs
+++ b/test/Apache.Arrow.Operations.Tests/VariantJson/VariantDecimalJsonTests.cs
@@ -16,7 +16,7 @@
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Text.Json;
-using Apache.Arrow.Operations.Json;
+using Apache.Arrow.Operations.VariantJson;
using Apache.Arrow.Scalars.Variant;
using Xunit;
diff --git a/test/Apache.Arrow.Operations.Tests/Json/VariantJsonTests.cs
b/test/Apache.Arrow.Operations.Tests/VariantJson/VariantJsonTests.cs
similarity index 99%
rename from test/Apache.Arrow.Operations.Tests/Json/VariantJsonTests.cs
rename to test/Apache.Arrow.Operations.Tests/VariantJson/VariantJsonTests.cs
index 1e230bd..dcb8f9d 100644
--- a/test/Apache.Arrow.Operations.Tests/Json/VariantJsonTests.cs
+++ b/test/Apache.Arrow.Operations.Tests/VariantJson/VariantJsonTests.cs
@@ -17,7 +17,7 @@ using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Text.Json;
-using Apache.Arrow.Operations.Json;
+using Apache.Arrow.Operations.VariantJson;
using Apache.Arrow.Scalars.Variant;
using Xunit;
diff --git a/test/Apache.Arrow.Variant.Benchmarks/EncodingBenchmarks.cs
b/test/Apache.Arrow.Variant.Benchmarks/EncodingBenchmarks.cs
index b90e21f..be5813e 100644
--- a/test/Apache.Arrow.Variant.Benchmarks/EncodingBenchmarks.cs
+++ b/test/Apache.Arrow.Variant.Benchmarks/EncodingBenchmarks.cs
@@ -17,7 +17,7 @@ using System.Buffers;
using System.Collections.Generic;
using System.Text;
using System.Text.Json;
-using Apache.Arrow.Operations.Json;
+using Apache.Arrow.Operations.VariantJson;
using Apache.Arrow.Scalars.Variant;
using BenchmarkDotNet.Attributes;