@@ -357,24 +357,25 @@ def test_limit():
357357 tm .assert_frame_equal (pandas_frame , my_frame )
358358
359359
360- # # TODO Add in parentheses support for Order of ops
361- #
362- # def test_having_multiple_conditions():
363- # """
364- # Test having clause
365- # :return:
366- # """
367- # my_frame = query(
368- # "select min(temp) from forest_fires having min(temp) > 2 and "
369- # "max(dc) < 200 or month = 'oct'"
370- # )
371- # pandas_frame = FOREST_FIRES.copy()
372- # pandas_frame["_col0"] = FOREST_FIRES["temp"]
373- # aggregated_df = pandas_frame.aggregate({"_col0": "min"}).to_frame().transpose()
374- # pandas_frame = aggregated_df[aggregated_df["_col0"] > 2]
375- # tm.assert_frame_equal(pandas_frame, my_frame)
376-
360+ def test_having_multiple_conditions ():
361+ """
362+ Test having clause
363+ :return:
364+ """
365+ my_frame = query (
366+ "select min(temp) from forest_fires having min(temp) > 2 and "
367+ "max(dc) < 200 or month = 'oct'"
368+ )
369+ pandas_frame = FOREST_FIRES .copy ()
370+ pandas_frame ["_col0" ] = FOREST_FIRES ["temp" ]
371+ aggregated_df = pandas_frame .aggregate ({"_col0" : "min" }).to_frame ().transpose ()
372+ pandas_frame = aggregated_df [aggregated_df ["_col0" ] > 2 ]
373+ tm .assert_frame_equal (pandas_frame , my_frame )
377374
375+ @pytest .mark .xfail (
376+ raises = ValueError ,
377+ reason = "Still can't do having without a group by in ibis" ,
378+ )
378379def test_having_one_condition ():
379380 """
380381 Test having clause
@@ -546,7 +547,8 @@ def test_union_all(pandas_frame1_for_set_ops, pandas_frame2_for_set_ops):
546547 ).reset_index (drop = True )
547548 tm .assert_frame_equal (pandas_frame , my_frame )
548549
549-
550+ @pytest .mark .xfail (raises = NotImplementedError , reason = "Waiting on ibis for "
551+ "implementation" )
550552def test_intersect_distinct (pandas_frame1_for_set_ops , pandas_frame2_for_set_ops ):
551553 """
552554 Test union distinct in queries
@@ -567,7 +569,8 @@ def test_intersect_distinct(pandas_frame1_for_set_ops, pandas_frame2_for_set_ops
567569 )
568570 tm .assert_frame_equal (pandas_frame , my_frame )
569571
570-
572+ @pytest .mark .xfail (raises = NotImplementedError , reason = "Waiting on ibis for "
573+ "implementation" )
571574def test_except_distinct (pandas_frame1_for_set_ops , pandas_frame2_for_set_ops ):
572575 """
573576 Test except distinct in queries
@@ -589,7 +592,8 @@ def test_except_distinct(pandas_frame1_for_set_ops, pandas_frame2_for_set_ops):
589592 )
590593 tm .assert_frame_equal (pandas_frame , my_frame )
591594
592-
595+ @pytest .mark .xfail (raises = NotImplementedError , reason = "Waiting on ibis for "
596+ "implementation" )
593597def test_except_all (pandas_frame1_for_set_ops , pandas_frame2_for_set_ops ):
594598 """
595599 Test except distinct in queries
0 commit comments