Skip to content

Commit 0aa30cd

Browse files
committed
ENH: Add unit tests for count
1 parent 1765760 commit 0aa30cd

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

dataframe_sql/tests/pandas_sql_functionality_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,3 +1156,27 @@ def test_boolean_order_of_operations_with_parens():
11561156
].reset_index(drop=True)
11571157

11581158
tm.assert_frame_equal(pandas_frame, my_frame)
1159+
1160+
1161+
def test_count():
1162+
"""
1163+
Test count star
1164+
:return:
1165+
"""
1166+
my_frame = query("select count(day) from forest_fires")
1167+
pandas_frame = FOREST_FIRES.copy()
1168+
pandas_frame = pandas_frame[["month"]].count().to_frame("_col0").reset_index(
1169+
drop=True)
1170+
tm.assert_frame_equal(pandas_frame, my_frame)
1171+
1172+
1173+
def test_count_star():
1174+
"""
1175+
Test the count aggregation
1176+
:return:
1177+
"""
1178+
my_frame = query("select count(*) from forest_fires")
1179+
pandas_frame = FOREST_FIRES.copy()
1180+
pandas_frame = pandas_frame[["month"]].count().to_frame("_col0").reset_index(
1181+
drop=True)
1182+
tm.assert_frame_equal(pandas_frame, my_frame)

0 commit comments

Comments
 (0)