Skip to content
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
18 changes: 12 additions & 6 deletions test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,17 @@ private static Schema GetTestSchema()
.Field(f => f.Name("f32").DataType(FloatType.Default).Nullable(true))
.Field(f => f.Name("f64").DataType(DoubleType.Default).Nullable(true))

.Field(f => f.Name("decimal32_9_3").DataType(new Decimal32Type(9, 3)).Nullable(true))
.Field(f => f.Name("decimal64_18_3").DataType(new Decimal64Type(18, 3)).Nullable(true))
.Field(f => f.Name("decimal128_19_3").DataType(new Decimal128Type(19, 3)).Nullable(true))
.Field(f => f.Name("decimal256_19_3").DataType(new Decimal256Type(19, 3)).Nullable(true))
.Field(f => f.Name("decimal256_40_2").DataType(new Decimal256Type(40, 2)).Nullable(false))

.Field(f => f.Name("binary").DataType(BinaryType.Default).Nullable(false))
.Field(f => f.Name("string").DataType(StringType.Default).Nullable(false))
.Field(f => f.Name("fw_binary_10").DataType(new FixedSizeBinaryType(10)).Nullable(false))
.Field(f => f.Name("binary_view").DataType(BinaryViewType.Default).Nullable(false))
.Field(f => f.Name("string_view").DataType(StringViewType.Default).Nullable(false))

.Field(f => f.Name("date32").DataType(Date32Type.Default).Nullable(false))
.Field(f => f.Name("date64").DataType(Date64Type.Default).Nullable(false))
Expand All @@ -79,6 +83,7 @@ private static Schema GetTestSchema()

.Field(f => f.Name("list_string").DataType(new ListType(StringType.Default)).Nullable(false))
.Field(f => f.Name("list_list_i32").DataType(new ListType(new ListType(Int32Type.Default))).Nullable(false))
.Field(f => f.Name("list_view_string").DataType(new ListViewType(StringType.Default)).Nullable(false))

.Field(f => f.Name("fixed_length_list_i64").DataType(new FixedSizeListType(Int64Type.Default, 10)).Nullable(true))

Expand Down Expand Up @@ -130,13 +135,17 @@ private static IEnumerable<dynamic> GetPythonFields()
yield return pa.field("f32", pa.float32(), true);
yield return pa.field("f64", pa.float64(), true);

yield return pa.field("decimal32_9_3", pa.decimal32(9, 3), true);
yield return pa.field("decimal64_18_3", pa.decimal64(18, 3), true);
yield return pa.field("decimal128_19_3", pa.decimal128(19, 3), true);
yield return pa.field("decimal256_19_3", pa.decimal256(19, 3), true);
yield return pa.field("decimal256_40_2", pa.decimal256(40, 2), false);

yield return pa.field("binary", pa.binary(), false);
yield return pa.field("string", pa.utf8(), false);
yield return pa.field("fw_binary_10", pa.binary(10), false);
yield return pa.field("binary_view", pa.binary_view(), false);
yield return pa.field("string_view", pa.string_view(), false);

yield return pa.field("date32", pa.date32(), false);
yield return pa.field("date64", pa.date64(), false);
Expand All @@ -151,6 +160,7 @@ private static IEnumerable<dynamic> GetPythonFields()

yield return pa.field("list_string", pa.list_(pa.utf8()), false);
yield return pa.field("list_list_i32", pa.list_(pa.list_(pa.int32())), false);
yield return pa.field("list_view_string", pa.list_view(pa.utf8()), false);

yield return pa.field("fixed_length_list_i64", pa.list_(pa.int64(), 10), true);

Expand Down Expand Up @@ -769,9 +779,7 @@ public unsafe void ExportBatch()
[SkippableFact]
public unsafe void RoundTripTestBatch()
{
// TODO: Enable these once this the version of pyarrow referenced during testing supports them
HashSet<ArrowTypeId> unsupported = new HashSet<ArrowTypeId> { ArrowTypeId.ListView, ArrowTypeId.BinaryView, ArrowTypeId.StringView, ArrowTypeId.Decimal32, ArrowTypeId.Decimal64 };
RecordBatch batch1 = TestData.CreateSampleRecordBatch(4, excludedTypes: unsupported);
RecordBatch batch1 = TestData.CreateSampleRecordBatch(4);
RecordBatch batch2 = batch1.Clone();

CArrowArray* cExportArray = CArrowArray.Create();
Expand Down Expand Up @@ -811,9 +819,7 @@ public unsafe void RoundTripTestBatch()
[SkippableFact]
public unsafe void RoundTripTestSlicedBatch()
{
// TODO: Enable these once this the version of pyarrow referenced during testing supports them
HashSet<ArrowTypeId> unsupported = new HashSet<ArrowTypeId> { ArrowTypeId.ListView, ArrowTypeId.BinaryView, ArrowTypeId.StringView, ArrowTypeId.Decimal32, ArrowTypeId.Decimal64 };
RecordBatch batch1 = TestData.CreateSampleRecordBatch(4, excludedTypes: unsupported);
RecordBatch batch1 = TestData.CreateSampleRecordBatch(4);
RecordBatch batch1slice = batch1.Slice(1, 2);
RecordBatch batch2 = batch1slice.Clone();

Expand Down
3 changes: 1 addition & 2 deletions test/Apache.Arrow.Tests/CDeviceDataInterfacePythonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ public unsafe void ImportRecordBatchFromPythonDevice()
public unsafe void RoundTripTestBatchViaDevice()
{
// C# -> Python (via device) -> C# round trip
HashSet<ArrowTypeId> unsupported = new HashSet<ArrowTypeId> { ArrowTypeId.ListView, ArrowTypeId.BinaryView, ArrowTypeId.StringView, ArrowTypeId.Decimal32, ArrowTypeId.Decimal64 };
RecordBatch batch1 = TestData.CreateSampleRecordBatch(4, excludedTypes: unsupported);
RecordBatch batch1 = TestData.CreateSampleRecordBatch(4);
RecordBatch batch2 = batch1.Clone();

CArrowDeviceArray* cExportDeviceArray = CArrowDeviceArray.Create();
Expand Down