MCPcopy Index your code
hub / github.com/huggingface/datasets / test_cast_decimal_array_to_features

Function test_cast_decimal_array_to_features

tests/test_table.py:1130–1137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1128
1129
1130def test_cast_decimal_array_to_features():
1131 arr = pa.array([[Decimal(0), Decimal(1)]])
1132 assert cast_array_to_feature(arr, List(Value("string"))).type == pa.list_(pa.string())
1133 assert cast_array_to_feature(arr, List(Value("string")), allow_primitive_to_str=False).type == pa.list_(
1134 pa.string()
1135 )
1136 with pytest.raises(TypeError):
1137 cast_array_to_feature(arr, List(Value("string")), allow_decimal_to_str=False)
1138
1139
1140@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

cast_array_to_featureFunction · 0.90
ListClass · 0.90
ValueClass · 0.90

Tested by

no test coverage detected