Skip to content

Conversation

@jgiannuzzi
Copy link
Member

This PR drops support for .NET 6.0 (support from Microsoft ended more than a year ago, on Nov 12th 2024) and adds support for .NET 10.0. It also requires a .NET 10.0 SDK to build.

@jgiannuzzi jgiannuzzi requested a review from adamreeve December 10, 2025 12:13
<ItemGroup>
<PackageReference Include="FsUnit" Version="5.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update was required because it had a transient dependency to a vulnerable version of Newtonsoft.Json


public unsafe long ReadBatch(long batchSize, Span<short> defLevels, Span<short> repLevels, Span<TValue> values, out long valuesRead)
{
#pragma warning disable CA2265
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new default warning was introduced in .NET 10. It is disabled because we truly need to compare to null.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not just be checking if the Spans are empty? The Span can't actually be null as it is a struct so this does look wrong to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was 100% sure I had tried to convert them to span.IsEmpty (it's a member, not a method) and that the tests were failing, but I must have made a different mistake back then because it's working just fine now. I'll update the PR soon!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, PR updated - the tests were failing because I had naively replace span == null with span.IsEmpty, but there are places where we passed an empty span for the values that then started to fail (specifically in ParquetSharp.LogicalBatchWriter.ArrayWriter.WriteBatch). I have removed these unnecessary null comparisons as they were not doing what we expected them to do. Please can you both double check my approach?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PublicAPIAnalyzers in .NET 10.0 required me to move those symbols into the individual framework-dependent PublicAPI.Shipped.txt files. I am not entirely sure why, but I couldn't make the project build without these changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it affected anything involving System.IntPtr. Weird.

adamreeve
adamreeve previously approved these changes Dec 10, 2025

public unsafe long ReadBatch(long batchSize, Span<short> defLevels, Span<short> repLevels, Span<TValue> values, out long valuesRead)
{
#pragma warning disable CA2265
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not just be checking if the Spans are empty? The Span can't actually be null as it is a struct so this does look wrong to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it affected anything involving System.IntPtr. Weird.


public unsafe long ReadBatch(long batchSize, Span<short> defLevels, Span<short> repLevels, Span<TValue> values, out long valuesRead)
{
if (values == null) throw new ArgumentNullException(nameof(values));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// than the length of <paramref name="defLevels"/> or <paramref name="repLevels"/>.</exception>
public unsafe void WriteBatch(int numValues, ReadOnlySpan<short> defLevels, ReadOnlySpan<short> repLevels, ReadOnlySpan<TValue> values)
{
if (values == null) throw new ArgumentNullException(nameof(values));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -366 to -369
if (values == null) throw new ArgumentNullException(nameof(values));
if (defLevels == null) throw new ArgumentNullException(nameof(defLevels));
if (repLevels == null) throw new ArgumentNullException(nameof(repLevels));
if (validBits == null) throw new ArgumentNullException(nameof(validBits));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgiannuzzi jgiannuzzi merged commit eff0f8e into G-Research:master Dec 11, 2025
50 checks passed
@jgiannuzzi jgiannuzzi deleted the net10.0 branch December 11, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants