Skip to content

Commit 0c1f471

Browse files
author
stonebig
committed
TST: issue (#3628) when writing a dataframe column of integers to sqlite
1 parent 83a6e09 commit 0c1f471

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/io/tests/test_sql.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,18 @@ def test_keyword_as_column_names(self):
219219
df = DataFrame({'From':np.ones(5)})
220220
sql.write_frame(df, con = self.db, name = 'testkeywords')
221221

222+
def test_onecolumn_of_integer(self):
223+
'''
224+
a column_of_integers dataframe should transfer well to sql
225+
'''
226+
mono_df=DataFrame([1 , 2], columns=['c0'])
227+
sql.write_frame(mono_df, con = self.db, name = 'mono_df')
228+
# computing the sum via sql
229+
con_x=self.db
230+
the_sum=sum([my_c0[0] for my_c0 in con_x.execute("select * from mono_df")])
231+
# it should not fail, and gives 3 ( Issue #3628 )
232+
self.assertEqual(the_sum , 3)
233+
222234

223235
class TestMySQL(unittest.TestCase):
224236

0 commit comments

Comments
 (0)