@@ -103,11 +103,32 @@ def test_simple(self):
103
103
class TestUnsupportedDataType (TestBsonToArrowConversionBase ):
104
104
105
105
def test_simple (self ):
106
-
107
106
schema = Schema ({'_id' : ObjectId ,
108
107
'data' : int64 (),
109
108
'fake' : pyarrow .float16 () })
110
109
msg = ("Unsupported data type in schema for field " +
111
110
'"fake" of type "halffloat"' )
112
111
with self .assertRaisesRegex (ValueError , msg ):
113
112
PyMongoArrowContext .from_schema (schema )
113
+
114
+
115
+ class TestNonAsciiFieldName (TestBsonToArrowConversionBase ):
116
+
117
+ def setUp (self ):
118
+ self .schema = Schema ({'_id' : ObjectId ,
119
+ 'dätá' : int64 ()})
120
+ self .context = PyMongoArrowContext .from_schema (
121
+ self .schema )
122
+
123
+ def test_simple (self ):
124
+ ids = [ObjectId () for i in range (4 )]
125
+ docs = [{'_id' : ids [0 ], 'dätá' : 10 },
126
+ {'_id' : ids [1 ], 'dätá' : 20 },
127
+ {'_id' : ids [2 ], 'dätá' : 30 },
128
+ {'_id' : ids [3 ], 'dätá' : 40 }]
129
+ as_dict = {
130
+ '_id' : [oid .binary for oid in ids ] ,
131
+ 'dätá' : [10 , 20 , 30 , 40 ]
132
+ }
133
+
134
+ self ._run_test (docs , as_dict )
0 commit comments