2424class TestBsonToArrowConversionBase (TestCase ):
2525 def setUp (self ):
2626 self .schema = Schema ({"_id" : ObjectId , "data" : int64 (), "title" : string ()})
27- self .context = PyMongoArrowContext . from_schema (self .schema )
27+ self .context = PyMongoArrowContext (self .schema )
2828
2929 @staticmethod
3030 def _generate_payload (doclist ):
@@ -36,7 +36,7 @@ def _generate_payload(doclist):
3636 def _run_test (self , doclist , as_dict ):
3737 payload = type (self )._generate_payload (doclist )
3838
39- process_bson_stream ( payload , self .context )
39+ self .context . process_bson_stream ( payload )
4040 table = self .context .finish ()
4141 table_dict = table .to_pydict ()
4242
@@ -104,13 +104,13 @@ def test_simple(self):
104104 schema = Schema ({"_id" : ObjectId , "data" : int64 (), "fake" : pa .float16 ()})
105105 msg = 'Unsupported data type in schema for field "fake" of type "halffloat"'
106106 with self .assertRaisesRegex (ValueError , msg ):
107- PyMongoArrowContext . from_schema (schema )
107+ PyMongoArrowContext (schema )
108108
109109
110110class TestNonAsciiFieldName (TestBsonToArrowConversionBase ):
111111 def setUp (self ):
112112 self .schema = Schema ({"_id" : ObjectIdType (), "dätá" : int64 ()})
113- self .context = PyMongoArrowContext . from_schema (self .schema )
113+ self .context = PyMongoArrowContext (self .schema )
114114
115115 def test_simple (self ):
116116 ids = [ObjectId () for i in range (4 )]
@@ -150,7 +150,7 @@ def test_object_id_type(self):
150150class TestInt64Type (TestBsonToArrowConversionBase ):
151151 def setUp (self ):
152152 self .schema = Schema ({"data" : Int64 })
153- self .context = PyMongoArrowContext . from_schema (self .schema )
153+ self .context = PyMongoArrowContext (self .schema )
154154
155155 def test_simple (self ):
156156 docs = [
@@ -165,7 +165,7 @@ def test_simple(self):
165165class TestBooleanType (TestBsonToArrowConversionBase ):
166166 def setUp (self ):
167167 self .schema = Schema ({"data" : bool })
168- self .context = PyMongoArrowContext . from_schema (self .schema )
168+ self .context = PyMongoArrowContext (self .schema )
169169
170170 def test_simple (self ):
171171 docs = [
@@ -183,7 +183,7 @@ def test_simple(self):
183183class TestStringType (TestBsonToArrowConversionBase ):
184184 def setUp (self ):
185185 self .schema = Schema ({"data" : str })
186- self .context = PyMongoArrowContext . from_schema (self .schema )
186+ self .context = PyMongoArrowContext (self .schema )
187187
188188 def test_simple (self ):
189189 docs = [
@@ -197,7 +197,7 @@ def test_simple(self):
197197class TestDecimal128Type (TestBsonToArrowConversionBase ):
198198 def setUp (self ):
199199 self .schema = Schema ({"data" : Decimal128 })
200- self .context = PyMongoArrowContext . from_schema (self .schema )
200+ self .context = PyMongoArrowContext (self .schema )
201201
202202 def test_simple (self ):
203203 docs = [
@@ -212,7 +212,7 @@ def test_simple(self):
212212class TestSubdocumentType (TestBsonToArrowConversionBase ):
213213 def setUp (self ):
214214 self .schema = Schema ({"data" : dict (x = bool )})
215- self .context = PyMongoArrowContext . from_schema (self .schema )
215+ self .context = PyMongoArrowContext (self .schema )
216216
217217 def test_simple (self ):
218218 docs = [
@@ -237,7 +237,7 @@ def test_simple(self):
237237
238238 def test_nested (self ):
239239 self .schema = Schema ({"data" : dict (x = bool , y = dict (a = int ))})
240- self .context = PyMongoArrowContext . from_schema (self .schema )
240+ self .context = PyMongoArrowContext (self .schema )
241241
242242 docs = [
243243 {"data" : dict (x = True , y = dict (a = 1 ))},
0 commit comments