@@ -495,7 +495,7 @@ def test_read_table_absent(self):
495495 self .assertRaises (
496496 ValueError , sql .read_table , "this_doesnt_exist" , con = self .conn )
497497
498- def test_default_type_convertion (self ):
498+ def test_default_type_conversion (self ):
499499 df = sql .read_table ("types_test_data" , self .conn )
500500
501501 self .assertTrue (issubclass (df .FloatCol .dtype .type , np .floating ),
@@ -589,7 +589,7 @@ def setUp(self):
589589
590590 self ._load_test1_data ()
591591
592- def test_default_type_convertion (self ):
592+ def test_default_type_conversion (self ):
593593 df = sql .read_table ("types_test_data" , self .conn )
594594
595595 self .assertTrue (issubclass (df .FloatCol .dtype .type , np .floating ),
@@ -755,6 +755,24 @@ def tearDown(self):
755755 for table in c .fetchall ():
756756 self .conn .execute ('DROP TABLE %s' % table [0 ])
757757
758+ def test_default_type_conversion (self ):
759+ df = sql .read_table ("types_test_data" , self .conn )
760+
761+ self .assertTrue (issubclass (df .FloatCol .dtype .type , np .floating ),
762+ "FloatCol loaded with incorrect type" )
763+ self .assertTrue (issubclass (df .IntCol .dtype .type , np .integer ),
764+ "IntCol loaded with incorrect type" )
765+ # MySQL has no real BOOL type (it's an alias for TINYINT)
766+ self .assertTrue (issubclass (df .BoolCol .dtype .type , np .integer ),
767+ "BoolCol loaded with incorrect type" )
768+
769+ # Int column with NA values stays as float
770+ self .assertTrue (issubclass (df .IntColWithNull .dtype .type , np .floating ),
771+ "IntColWithNull loaded with incorrect type" )
772+ # Bool column with NA = int column with NA values => becomes float
773+ self .assertTrue (issubclass (df .BoolColWithNull .dtype .type , np .floating ),
774+ "BoolColWithNull loaded with incorrect type" )
775+
758776
759777class TestPostgreSQLAlchemy (_TestSQLAlchemy ):
760778 flavor = 'postgresql'
0 commit comments