Skip to content

Commit

Permalink
apacheGH-38297: [C#] Fix build for .NET 4.7.2 (apache#38299)
Browse files Browse the repository at this point in the history
### What changes are included in this PR?

Fixes apache#38297 

### Are these changes tested?

Yes
* Closes: apache#38297
  • Loading branch information
CurtHagenlocher authored and dgreiss committed Feb 17, 2024
1 parent 1df8f99 commit b500655
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ static TimeUnit RequiredPrecision(TimeSpan? timeSpan)
{
if (timeSpan == null) { return TimeUnit.Second; }
if ((timeSpan.Value.Ticks % TicksPerMicrosecond) > 0) { return TimeUnit.Nanosecond; }
#if NET5_0_OR_GREATER
if (timeSpan.Value.Microseconds > 0) { return TimeUnit.Microsecond; }
#else
if ((timeSpan.Value.Ticks % (TicksPerMicrosecond * 1000)) > 0) { return TimeUnit.Microsecond; }
#endif
if (timeSpan.Value.Milliseconds > 0) { return TimeUnit.Millisecond; }
return TimeUnit.Second;
}
Expand Down
6 changes: 3 additions & 3 deletions csharp/test/Apache.Arrow.Tests/MapArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public void MapArray_Should_GetKeyValuePairs()
var keyBuilder = builder.KeyBuilder as StringArray.Builder;
var valueBuilder = builder.ValueBuilder as Int32Array.Builder;

KeyValuePair<string, int?> kv0 = KeyValuePair.Create("test", (int?)1);
KeyValuePair<string, int?> kv1 = KeyValuePair.Create("other", (int?)123);
KeyValuePair<string, int?> kv2 = KeyValuePair.Create("kv", (int?)null);
KeyValuePair<string, int?> kv0 = new KeyValuePair<string, int?>("test", (int?)1);
KeyValuePair<string, int?> kv1 = new KeyValuePair<string, int?>("other", (int?)123);
KeyValuePair<string, int?> kv2 = new KeyValuePair<string, int?>("kv", (int?)null);

builder.Append();
keyBuilder.Append("test");
Expand Down

0 comments on commit b500655

Please sign in to comment.