Skip to content

Commit 70d1f3e

Browse files
author
Saumitra Shahapure
committed
Ensuring correct schema for zero-rows output. Adding comment for bug ID
1 parent 727de8b commit 70d1f3e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/io/tests/test_gbq.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ def test_download_dataset_larger_than_200k_rows(self):
297297
self.assertEqual(len(df.drop_duplicates()), 200005)
298298

299299
def test_zero_rows(self):
300-
df = gbq.read_gbq("SELECT * FROM [publicdata:samples.wikipedia] where timestamp=-9999999", project_id=PROJECT_ID)
301-
tm.assertIs(df, DataFrame, "Zero rows result should be dataframe.")
302-
self.assertEqual(len(df), 0)
300+
# Bug fix for https://github.com/pydata/pandas/issues/10273
301+
df = gbq.read_gbq("SELECT title, language FROM [publicdata:samples.wikipedia] where timestamp=-9999999", project_id=PROJECT_ID)
302+
expected_result = DataFrame(columns=['title', 'language'])
303+
self.assert_frame_equal(df, expected_result)
303304

304305

305306
class TestToGBQIntegration(tm.TestCase):

0 commit comments

Comments
 (0)