This is an automated email from the ASF dual-hosted git repository.
curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 71a76c340c GH-38297: [C#] Fix build for .NET 4.7.2 (#38299)
71a76c340c is described below
commit 71a76c340c6dfe1fcde51b22f718a26da4edd7bc
Author: Curt Hagenlocher <[email protected]>
AuthorDate: Mon Oct 16 16:01:27 2023 -0700
GH-38297: [C#] Fix build for .NET 4.7.2 (#38299)
### What changes are included in this PR?
Fixes #38297
### Are these changes tested?
Yes
* Closes: #38297
---
csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs | 4 ++++
csharp/test/Apache.Arrow.Tests/MapArrayTests.cs | 6 +++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs
b/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs
index 0890d356b8..3395ca7bc9 100644
--- a/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs
+++ b/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs
@@ -69,7 +69,11 @@ namespace Apache.Arrow.Tests
{
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;
}
diff --git a/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs
b/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs
index 034f120f3f..7f35f10426 100644
--- a/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs
+++ b/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs
@@ -62,9 +62,9 @@ namespace Apache.Arrow.Tests
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");