Skip to content

Commit

Permalink
Merge pull request #119 from laughingman7743/#117
Browse files Browse the repository at this point in the history
Fix PandasCursor to not ignore rows containing only null values (fix #117)
  • Loading branch information
laughingman7743 committed Feb 6, 2020
2 parents 3812712 + 51f7140 commit 599dde9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyathena/result_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ def _as_pandas(self):
dtype=self.dtypes,
converters=self.converters,
parse_dates=self.parse_dates,
infer_datetime_format=True)
infer_datetime_format=True,
skip_blank_lines=False)
df = self._trunc_date(df)
else: # Allow empty response
df = pd.DataFrame()
Expand Down
7 changes: 7 additions & 0 deletions tests/test_pandas_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,10 @@ def test_executemany_fetch(self, cursor):
self.assertRaises(ProgrammingError, cursor.fetchmany)
self.assertRaises(ProgrammingError, cursor.fetchone)
self.assertRaises(ProgrammingError, cursor.as_pandas)

@with_pandas_cursor()
def test_not_skip_blank_lines(self, cursor):
cursor.execute("""
select * from (values (1), (NULL))
""")
self.assertEqual(len(cursor.fetchall()), 2)

0 comments on commit 599dde9

Please sign in to comment.